VirtualGrid reset to default filter operation

1 Answer 27 Views
VirtualGrid
Emanuele
Top achievements
Rank 1
Iron
Iron
Emanuele asked on 24 Oct 2025, 07:21 AM

Good morning,

in VirtualGrid is there a way to reset to the default filter operator for each column when using grid.FilterDescriptors.Clear()?

For example if the user has changed the operator to "EndsWith" in one column and "StartsWith" in another one, I would like to reset them to "Contains" when clearing filters.

It seems that the method grid.FilterDescriptors.Clear() clear only the filters values.

Thank you.

 

Emanuele

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 28 Oct 2025, 02:29 PM

Hello, Emanuele,

To reset the filter operator (for example, back to "Contains") after clearing filters, you need to manually set. You can add a FilterDescriptor and specify the PropertyName that points to a certain column from grid. Here’s how you can achieve this:

  • After clearing the filters, iterate through the columns and create a new FilterDescriptor for each column, setting its Operator property to FilterOperator.Contains.
  • Add these new filter descriptors to the grid's FilterDescriptors collection.

Example code:

 private void radButton1_Click(object sender, EventArgs e)
 {
     radVirtualGrid1.FilterDescriptors.Clear();

     FilterDescriptor filter = new FilterDescriptor();
     filter.PropertyName = "ContactName";
     filter.Operator = FilterOperator.Contains;
     filter.Value = "";
     this.radVirtualGrid1.FilterDescriptors.Add(filter);
 }

This approach ensures that the filter operator for each column is reset to "Contains" after filters are cleared.

For more details on programmatically setting filters:

Let me know if you have any further questions.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Emanuele
Top achievements
Rank 1
Iron
Iron
commented on 06 Nov 2025, 10:02 AM

Hello Nadya,

thank you for your response. Your solution works partially because the funnel remains highlighted (you can see this behavior also in your gif) and the end-user could be confused.

My aim is to reset all the filters to the default empty values/state, for both string and number columns.

Thank you.

 

Emanuele

Nadya | Tech Support Engineer
Telerik team
commented on 10 Nov 2025, 12:52 PM

Hello, Emanuele,

Yes, you are right the funnel remains highlighted but this is expected as we are actually adding a new FilterDescriptor. As long as there is a FilterDescriptor added, the icon will indicate a filter is applied.

Having your case mind, I agree that calling FilterDescriptors.Clear() is supposed to clear all descriptors applied in grid and reset the filter cells to its default state. I logged a bug report on your behalf in our feedback portal, so that our developers can fix this in our future releases: RadVirtualGrid: FilterDescriptors.Clear() do not reset the filter operator text

I also updated your Telerik Points for bringing this to our attention. 

I hope this infromation helps. If you have any other questions, do not hesitate to contact me.

Tags
VirtualGrid
Asked by
Emanuele
Top achievements
Rank 1
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or