Sorry if this has been discussed, I searched but did not find anything. I have the below code in the code behind of my View, but would like to move it to the viewmodel and use binding to set it. I know how to set everything up except for binding the DistinctFilter. Is this possible? If you need more information, I'll try to provide as much as I can.
private
void
ChartSelectionBehavior_SelectionChanged(
object
sender, Telerik.Windows.Controls.ChartView.ChartSelectionChangedEventArgs e)
{
grid.FilterDescriptors.SuspendNotifications();
IColumnFilterDescriptor filter = grid.Columns[
"Status"
].ColumnFilterDescriptor;
filter.SuspendNotifications();
foreach
(var point
in
e.AddedPoints)
{
var value = ((PieChartData)point.DataItem).Label;
filter.DistinctFilter.AddDistinctValue(value);
}
foreach
(var point
in
e.RemovedPoints)
{
var value = ((PieChartData)point.DataItem).Label;
filter.DistinctFilter.RemoveDistinctValue(value);
}
filter.ResumeNotifications();
grid.FilterDescriptors.ResumeNotifications();
}