RadChart allows you to programmatically filter its data using FilterDescriptors as demonstrated in our help topic. However there are scenarios where you would like to have more complex filtering. For a sample scenario where a Chart is drawn according to the filtered RadGridView’s data - read further.
The Chart and the GridView will be populated with the same data source – List of Business Objects:
The binding is done in XAML. The Chart is bound via SeriesMappings which you can find described in our online documentation – DataBinding with Manual Series Mappings.
As for the GridView – several properties (relating grouping, selecting and sorting) are turned off for simplicity.
By handling the Filtered event of the GridView, you may set the GridView filter descriptors directly to the chart using the IFilterDescriptor interface:
As an alternative you may create a ComplexFilterDescriptor manually.
The pictures below show the sample in action:
1. The Chart and the GridView on initial load:
2. Filtering the SampleValue column:
3. The result:
You may download the full source code from here!
Telerik XAML Team