WinForms RadGrid Filter

2 Answers 65 Views
FilterView
Renuka
Top achievements
Rank 1
Renuka asked on 08 Feb 2023, 05:45 AM
Is their any method to get all the column names in Radgrid that containing filter icon ?

2 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 09 Feb 2023, 12:57 PM

Hello Renuka,

Thank you for your interest in our control for WinForms.

I will need more information regarding your requirement. What do you mean by filter icon? Do you want to get which column is filtered by the user or do you want to get the icon of the columns which can be filtered?

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Renuka
Top achievements
Rank 1
commented on 09 Feb 2023, 07:37 PM

Hi Dinko

I want while loading the radgrid if any filters (saved layout) their then that filter enable column names.

 

Thanks

Dinko | Tech Support Engineer
Telerik team
commented on 10 Feb 2023, 12:00 PM

It's still fully clear to me what is your requirement. What I understood is that you are loading a layout to the RadGridView. At some point of loading you want to check if a column has a filter applied and get its name. Am I right?
Renuka
Top achievements
Rank 1
commented on 10 Feb 2023, 01:32 PM

Yes
0
Dinko | Tech Support Engineer
Telerik team
answered on 13 Feb 2023, 01:31 PM

Hi Renuka,

Thank you for confirming this.

You can subscribe to the LayoutLoaded event of the RadGridView. This event will be called when the load process is finished. In the event handler, you can iterate the Columns collection of the control and check if the FilterDescriptor property is null. If it is not, then a filter has been applied.

this.radGridView1.LayoutLoaded += RadGridView1_LayoutLoaded;

private void RadGridView1_LayoutLoaded(object sender, LayoutLoadedEventArgs e)
{
    foreach (var column in this.radGridView1.Columns)
    {
        if(column.FilterDescriptor != null)
        {
            string columnName = column.Name;
        }
    }
}

I hope that this approach will work for you.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
FilterView
Asked by
Renuka
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or