Programmatically Apply Filters

1 Answer 169 Views
FilterView
Martin Hamilton
Top achievements
Rank 1
Iron
Iron
Veteran
Martin Hamilton asked on 11 Feb 2022, 05:04 PM

I have a FilterView on the form as well as a GridView

When I apply the filter - the gridview filters as expected.

When I refresh the grid, the selected filters on the FilterView remain in place - which is what I want.

But the GridView (after the refresh) shows all of the data.

What I'd like to do is something like FilterView1.ApplyFilters to cause the Grid to filter accordingly... but I do not see such a method.

Is there some way that I could programmatically tell the FilterView to 're-apply' the selected filters?

Of course, if I deselect and then reselect a filter element the grid view will get filtered appropriately - but, I'd like to just tell the filter to 're-apply' then selected filters programmatically.

How can I do this?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 14 Feb 2022, 10:02 AM
Hello, Martin,    

We already have a feature request for RadFilterView to allow applying filters programmatically. You can track its progress, subscribe for status changes and add your comments on the following link:
https://feedback.telerik.com/winforms/1550688-radfilterview-filterdescriptors-added-via-code-don-t-show-in-control 

Currently, the possible solution that I can suggest is to apply the values directly to the category elements that are generated in RadFilterView: 
this.radFilterView1.AssociatedControl = this.radGridView1;
    FilterViewNumericCategoryElement productIDCategory = this.radFilterView1.Categories[0] as FilterViewNumericCategoryElement;
    productIDCategory.MaxValueSpinEditor.Value = 5;
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
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
Martin Hamilton
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or