Handling filter by my own

2 posts, 0 answers
  1. Ahmad
    Ahmad avatar
    27 posts
    Member since:
    May 2015

    Posted 18 Oct 2016 Link to this post

    In my project, I can't set all data in ItemsSource.
    I want when user filter, I set data to ItemsSource(note: I don't want Telerik to filter current data).

    I handle the Filtered event and I set My data to ItemsSource in this function. but Telerik filters new data again.
    What am I do to force Telerik don't filtering data by itself?
  2. Stefan
    Stefan avatar
    799 posts

    Posted 19 Oct 2016 Link to this post

    Hi Ahmad,

    The Filtered event of RadGridView is triggered when the filtering operation has already been processed. Thus, handling it cannot cancel the filtering that the user has performed through the UI. This data operation can be canceled by subscribing to the Filtering event of the control and setting the Cancel property of the event arguments to true. More information can be found in the Event Model topic. Note, that with such approach the control will also behave as not being filtered, as if the FilteringControl is not working at all. I am afraid, that the control cannot be forced to visually behave as filtered, without the actual data operation to be processed.

    The other solutions for disabling the filtering of RadGridView are described in the Disable Filtering for a Specific Column and Disable Filtering for the Entire Grid help topics.

    For such requirement, I suggest you trying to implement a Custom Filtering Control. You may also find the Custom Filtering Control SDK Example useful. It can be reviewed through the SDK Samples Browser.

    Hope this helps.

    Stefan X1
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top