VirtualGrid reset to default filter operation

1 Answer 10 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
Tags
VirtualGrid
Asked by
Emanuele
Top achievements
Rank 1
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or