Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
How to Retrieve elements corresponding to a filter in XamGrid


as stated in the subject I need to get a list of the data elements in a xamgrid that are currently visible when a filter is applied.

In Windows Forms there were objects that allowed to retrieve a collection of the filtered in or out rows of the grid.

In WPF I haven't fount nothing so how do you suggest to proceed? is there at last a way to retrieve filter types and values to

apply the filter on the underlying data collection?

Thank you in advance


No Data
  • 34310
    Verified Answer
    Offline posted

    Hello Sabrina,

    Thank you for your post.

    The XamGrid has a Rows property which you can utilize for this requirement. When you filter the XamGrid, that Rows collection is updated to reflect the rows that are filtered into the grid. Each row in the grid has a Data property, which you can use to retrieve the data item from the row. So, if you loop through each of the rows in the XamGrid.Rows collection, and place each of their data items in a collection, you can compare that collection to the collection that is bound to your XamGrid and find the data items that exist in your collection, but not in the Row data items collection. This will give you the filtered out data items.

    I have attached a sample application to demonstrate the above. In it, simply apply a filter, and click the button to see the demonstration.

    Please let me know if you have any other questions or concerns on this matter.

    Associate Developer
    Infragistics Inc.