This is what I want to do... tell me if I'm crazy.
I would like to filter data based on a many to many relationship...
Lets say we have People, and Widgets that are tied together via PeopleWidgets.
If I have a grid of People and a column for their Widgets - is it possible to have a custom filtering control that lets them which Widgets to choose from. Actually - I've made it that far, but now the problem is getting the FilterDescriptor to behave as desired. This is what I have...
But this is obviously not working. Basically I'm trying to go another level deeper in my "Member" property of the FilterDescriptor.
Any ideas?
I would like to filter data based on a many to many relationship...
Lets say we have People, and Widgets that are tied together via PeopleWidgets.
If I have a grid of People and a column for their Widgets - is it possible to have a custom filtering control that lets them which Widgets to choose from. Actually - I've made it that far, but now the problem is getting the FilterDescriptor to behave as desired. This is what I have...
List<long> widgetIDs = new List<long>(); |
foreach (CheckBox checkBox in this.ChildrenOfType<CheckBox>().Where(cb => cb.IsChecked == true)) |
{ |
widgetIDs.Add((checkBox.DataContext as Widget).WidgetID); |
} |
if (widgetIDs.Count > 0) |
{ |
Telerik.Windows.Data.FilterDescriptor fd = new Telerik.Windows.Data.FilterDescriptor(); |
fd.Member = "PeopleWidgets.WidgetID"; |
fd.Operator = Telerik.Windows.Data.FilterOperator.IsContainedIn; |
fd.Value = widgetIDs; |
} |
But this is obviously not working. Basically I'm trying to go another level deeper in my "Member" property of the FilterDescriptor.
Any ideas?