user61477
user61477

Reputation: 182

WPF Binding relational ComboBox's from L2S with filtering on all of them

in a WPF project with Linq to SQL, if you use the O/R - designer to create a simple structure with 3 that are all tied with forgin key relataions like so:

Customer <-- Orders <-- Items, and say i want a simpe window with 3 syncronized comboboxes when you select a customer you see only his orders and when you select an Order you see only the Items for that Order. all of this is simple....

Lets say i want to add filtering capablities to all the comboboxes. how would i do that if i want to use the entity objects from the LINQ dbml file?

Edit - Elaborating on filtering. i would like to filter the in memory collection without the need to query the database again, the filter can be a textbox that is over the combobox, that doest matter, my problem is that i cant filter the comboboxes because the are bound to an EntitySet through the L2S and dont implement filtering.

Thanks, Eric

Upvotes: 0

Views: 717

Answers (1)

Bryan Anderson
Bryan Anderson

Reputation: 16129

I would look into using CollectionViewSource. Bea Stollnitz has a good primer on it here and I used this blog post to show me how to filter. This will let you filter and sort without having to use the database and is pretty fast.

Upvotes: 1

Related Questions