Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering a bindingsource 1

Status
Not open for further replies.

wawalter

Programmer
Aug 2, 2001
125
0
0
US
Hello,

I am using a DataGridView databound to a BindingSource to bind to a List Collection. The binding works and I can update my List.

Now, I'm trying to get it to filter the List when I load in to the datagridview. The BindingSource has a filter property, but from what I read I think that only works out of the box with a DataSet/Table not a List collection.

How can I (or can I) use the BindingSource to filter the data coming from my List without breaking the binding?

Thanks,
Bill
 
i don't work in the desktop world,and know nothing about the BindingSource object. that said, could you query the object creating the List<> and reset the BindingSource?

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
That is pretty much what I ended up doing. I made a copy of my original List<> and changed the data source to point to that. I was afraid I'd lose the data bindings ability to make changes to the original list but it my copy must be a reference to the original because any changes I make on the grid are reflected in the original.

I think I should be able to implement IBindingListView and filter my original list, but it is working now, so I'll come back to that later (maybe).

Thanks for the reply,
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top