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

How to handle Filter Button event

11 Answers 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pushpendra
Top achievements
Rank 1
Pushpendra asked on 04 Dec 2012, 12:18 PM
Hi,

How can I handle Filter Button event of RadGridView Filter Popup Window?

Thanks,
Pushpendra

11 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 04 Dec 2012, 12:20 PM
Hello,

What is the reason for handling this event?

All the best,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Pushpendra
Top achievements
Rank 1
answered on 04 Dec 2012, 12:25 PM
Hi Rossen,

By clicking on the Filter button I want to perform server side search using FilterDescriptors, so need to handle Filter Button Click event.

Thanks,
Pushpendra
0
Vlad
Telerik team
answered on 04 Dec 2012, 01:05 PM
Hello,

 For server-side filtering you can use WCF RIA services or WCF Data services

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Pushpendra
Top achievements
Rank 1
answered on 04 Dec 2012, 01:24 PM
Hi Vlad,

As per my requierment I have to handle Filter button Click event of RadGridView Filtring popup, can we achieve that?
Also I have tried to open these links but it is asking for Silverlight 5, and my application is on Silverlight 4 with Telerik Q2 2011 SP1. Can we do Server side filtring using these versions?

Regards,
Pushpendra
0
Pushpendra
Top achievements
Rank 1
answered on 05 Dec 2012, 05:14 AM
Hi,

Can we handle Filter Button event of RadGridView Filter Popup Window, if yes how?

Thanks,
Pushpendra

0
Pushpendra
Top achievements
Rank 1
answered on 06 Dec 2012, 03:23 PM
Hi,

Is it possible to find out "PART_ApplyFilterButton" from the GridView Filtring Control?  I have tried to find Filtring Control and Filter Button using "ChildrenOfType" but it is always returning null.
gridView1.ChildrenOfType<Button>().Where(b => b.Name == "PART_ApplyFilterButton").ToList(); 
gridView1.ChildrenOfType<FilteringControl>().Where(b => b.Name == "PART_DisctinctFilter").ToList();

Please suggest how can I find filter button.

Thanks,
Pushpendra
0
Pushpendra
Top achievements
Rank 1
answered on 07 Dec 2012, 10:01 AM
Hi,

Can anyone will please tell that:
Is it possible to handle Filter Button event of RadGridView Filtering Popup so that I can cancel its default search and perform my own based on its Filter Criteria, in any Telerik Control Version.
Can we do this or not? It is very urgent to me.

Thanks,
Pushpendra
0
Rossen Hristov
Telerik team
answered on 07 Dec 2012, 10:44 AM
Hi,

You can attach to the Filtering or Filtered event of the grid and perform your custom filtering. But if you cancel the Filtering event -- you will use the values that the user has entered in the UI so that is not advisable.

Kind regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rossen Hristov
Telerik team
answered on 07 Dec 2012, 10:50 AM
Hello,

I meant you will lose the values that the user has entered in the UI.

Anyway, this button is not in the grid. It is in the filtering control which is shown in a Popup only when the user clicks. So you cannot find it like this.

If you really want to find this button, you have to inherit from our stock FilteringControl class, assing your inhertied class to the FilteringControl property of the column and then override the OnApplyTemplate method. There you can find the button with ChildrenOfType.

But again, if you cancel the filtering of the grid all values thaty user entered will be lost.

The documentation has more details about custom filtering controls and other aspects of filtering. Please, check the docs.

Greetings,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Pushpendra
Top achievements
Rank 1
answered on 07 Dec 2012, 11:22 AM
Hi Rossen,

Thanks for the reply. Yes I tried Filtering event but in Filtring event values are present in "e.Added" and not in "e.ColumnFilterDescriptor", and from "e.Added" we can't find out that the value is from DistinctFilter or from FieldFilter so it is not working. Also I was trying to search the Filter button to implement the solution but in that case also if I will not get the user input then it is of no use.
Actually this is a client requirement we are hanged on it. Also we can't use WCF Ria Service / WCF Data Service only for Filtring, since we can't change our whole architecture using which we are managing huge amount of data using custom paging.
Please let us know if there is any other solution for this issue.

Thanks,
Pushpendra
0
Rossen Hristov
Telerik team
answered on 07 Dec 2012, 11:51 AM
Hi,

1. You can implement your very own custom filtering control and you will have total freedom over everything.

2. If you decide to stick with our stock FilteringControl, you can implement a custom ColumnFilterDescriptor inheriting from our stock ColumnFilterDescriptor. Since you don't want the grid to do any filtering at all, your custom ColumnFilterDescriptor can return a Expression.Contstant(true, typeof(bool))  LINQ expression, meaning that all records pass the filter. Since your custom ColumnFilterDescriptor is inheriting from our stock one, you will be able to read the data that the user has entered by examining base.* properties. Based on this data, you can perfrom any kind of "outside" filtering.

I have attached two sample projects that utilize a custom ColumnFilterDescriptor. While they are not meant for your case exactly, you can examine and debug them in order to tailor them for your specific requirement.

Regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Pushpendra
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Pushpendra
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or