filter cartesianchart based on datagrid filter?

2 posts, 0 answers
  1. mark
    mark avatar
    3 posts
    Member since:
    Mar 2019

    Posted 29 Mar 2019 Link to this post

    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?

  2. Lance | Manager - Technical Support
    Lance | Manager - Technical Support avatar
    1100 posts

    Posted 01 Apr 2019 Link to this post

    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.


    • 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();

    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
Back to Top