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

gridview filter

1 Answer 110 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lily
Top achievements
Rank 1
Veteran
Lily asked on 13 Feb 2020, 04:54 AM

     Hi, I've been researching and trying to understand the custom filtering, but can't seem to understand it. I currently have a gridview with 5 columns.  I plan to have 4 text box and 1 dropdown that I want to use to filter the gridview.   I have tried the custom filtering from (https://www.telerik.com/videos/winforms/filtering-and-expressions-in-radgridview-for-winforms) but this is more on the style and doesn't hide the non-filtered rows.  I have tried to understand the custom filtering row in Demo application >> GridView >> Filtering >> Custom Filtering Row however, this is a bit too complicated with the usercontrols...  I've attached what my page looks like...  I can't seem to get the filtering on this page correct.  Can someone help?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Feb 2020, 08:44 AM

Hello, Lily,

I will try to explain in details how the custom filtering works.

Note that the custom filtering has higher priority than the basic filtering. It is necessary to set the EnableCustomFiltering property to true. Then, subscribe to the CustomFiltering event. It allows you to control whether a row is visible or not when the filtering is handled. The GridViewCustomFilteringEventArgs event offers the following arguments:
- Handled - controls whether the default filtering logic will be performed or your custom one. Set the Handled argument to true if you want to control whether the row is visible or not.
- Visible - defines if the row is visible or hidden from the filtering results if the Handled argument is set to true. 
- Row - gives you access to the row that is currently beinŠ³ processed.

Please refer to the following help article which is quite useful on this topic: https://docs.telerik.com/devtools/winforms/controls/gridview/filtering/custom-filtering 

I would recommend you to have a look at our Demo application >> GridView >> Filtering >> Custom Filtering example. It shows how to control which rows to be filtered by a single RadTextBox control.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Lily
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or