This is a migrated thread and some comments may be shown as answers.

filter cartesianchart based on datagrid filter?

1 Answer 65 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
mark asked on 29 Mar 2019, 05:39 PM

I'm using a datagrid bound to an observablecollection. I'd like to add a cartesianchart, that mirrors the datagrid.

Any filtering applied to the datagrid should also be applied to the chart.

How do I do this?

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 01 Apr 2019, 02:32 PM
Hello Mark,

The DataGrid is not going to manipulate the original data source (in your case an ObservableCollection), instead these operations occur on the DataView. You can get the currently filter/sorted/grouped data from the DataGrid by using the DataView.

Once you have the DataView, you can then populate external things, like a chart.

Properties

  • IsDataReady: Determines whether all the internal data operations are completed and the view may be properly accessed.
  • Items: Gets the top-level items within the view. These might be either IDataGroup instances or data items if no grouping is applied.

The code snippets on this page will use a variable which will hold the current View of the DataGrid:

IDataView currentView = this.grid.GetDataView();


Regards,
Lance | Technical Support Engineer, Principal
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataGrid
Asked by
mark
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or