troubleshooting Question

Please help with filtering observablecollection using checkboxes

Avatar of ajk825
ajk825 asked on
Visual Basic.NETVB ScriptMicrosoft SQL Server 2008
14 Comments1 Solution677 ViewsLast Modified:
Hello. i am very new to wpf and entity framework and I've ran into a snag...I'm using ado.net entity data model. i have an entity, generated from a database.... BoxEntity.  this entity is made up of the tables in my database. there are 8 tables total.

1 parent table,  that is my:

 <CollectionViewSource x:Key="RcViewSource" />

7 of the tables in my BoxEntity are child tables.  these are my :

        <CollectionViewSource Source="{Binding Source={StaticResource RcViewSource},Path='Specs'}" x:Key="SpecsViewSource"/>
        <CollectionViewSource Source="{Binding Source={StaticResource RcViewSource},Path='Holds'}" x:Key="HoldsViewSource"/>
        <CollectionViewSource Source="{Binding Source={StaticResource RcViewSource},Path='Lifes'}" x:Key="LifesViewSource"/>
        <CollectionViewSource Source="{Binding Source={StaticResource RcViewSource},Path='ToDs'}" x:Key="ToDsViewSource"/>
        <CollectionViewSource Source="{Binding Source={StaticResource RcViewSource},Path='Crs'}" x:Key="CrsViewSource"/>

1 table i haven't done anything with yet.

5 of the tables/views (shown above) are all checkboxes/ booleans/  true/false answers, no input required but check a box for true, leave it blank for false.

 I tried to find another way to do it, but they are all yes/no columns. And i didn't want to use RadioButtons, just not fond of the way they look.

so... I need to sort/filter the main view (RcViewSource) by the other 5 views. so  i have a window something like this:

This is how my Search form is set up....
 and if the user selects Appetizers, Breakfast, and Vegan..... all the recipe names containing those 3 items will show up in the listbox when they hit the "Search" button.

I"ve attached a copy of my SearchMe.xaml.vb code behind. As you can see I hard coded the button to search for Appetizers when clicked, but their has to be an easier, more efficient way to do the filtering.

I've also attached a copy of my RecipeList, this is my ObservableCollection, as you can see I'm very lost.. And their are NO resources on the web dealing with checkbox bindings, unless you want to change the color of the text .....

Last thing is I need to pass the value of the Item Selected to another window to display the actual recipe.

Or... If there is a way I could write a SQL stored procedure to do all the above that would be great also.....

This has been giving me problems for about 3 months now. Please someone help....
Any and all input or suggestions would be extremely appreciated...
Thanks, Adam
RecipeList.txt
SearchMe-form.txt
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros