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

How To Fire Filter Event

3 Answers 308 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 2
Andy asked on 02 Aug 2011, 04:27 AM
I have a RadGrid with Filters.  The user can browse to another page (details page) from the page with the RadGrid.  When the user returns I restore the filters to their state when the user browsed away.  This is done via Session data.

The search criteria is restored along with the filter values.  The data is read from the datbase and all is well except that the FILTERs were not honored.In other words, all records are displayed that meet the search criteria, but the filters are not applied.

I think I need to cause a filter event to fire, as if the user had clicked the filter ICON.  How do I cause this to happen?

Thanks for your help.


3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 02 Aug 2011, 04:53 AM
Hello Andy,

You can achieve this by checking for CommandName in ItemCommand event.
C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
 if (e.CommandName == RadGrid.FilterCommandName)
 {
     //your code here
 }
}

Thanks,
Princy.
0
Trevor
Top achievements
Rank 1
answered on 04 Oct 2014, 09:26 AM
Yo uhave not answered his queston.,

he doesnt want to detect the event.

He want to @cause@/ fire  the event.

I also want to have a button, that clears the filters ,THEN redispay the page.on the client..


I can clear the filters but page remains the same..

As usual with telerik something so simple seems so hard..


0
Konstantin Dikov
Telerik team
answered on 08 Oct 2014, 03:32 PM
Hello Trevor,

For clearing the filters you will need to traverse through each column, set the CurrentFilterValue to an empty string and rebind the grid.

An example of such implementation could be found for the second RadGrid in the following online demo:
Additionally, you could examine the following forum thread, where some examples are also available:
Hope this helps.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Andy
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Trevor
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or