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

How to raise a Postback on filter manually?

5 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Käse
Top achievements
Rank 1
Käse asked on 01 Sep 2015, 09:38 AM

Hello,

 I have a <telerik:RadGrid> which contains some <telerik:GridBoundColumn> elements. Until now the AutoPostBackOnFilter value was set to true. This means the grid had its contents updated every time I left the focus of one of the GridBoundColumns. This is not a desired behavior anymore. Now I just want to trigger the filtering manually by let's say clicking on a button. So I set all the AutoPostBackOnFilter values to false and created a button with the according serverside event handler, which is empty so far :)

 How could I implement this requirement?

 Thanks in advance!

5 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Sep 2015, 01:42 PM
Hi Käse,

This requirement is the default behavior of the built-in functionality provided by RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Käse
Top achievements
Rank 1
answered on 09 Sep 2015, 07:05 AM

Correct me if I am wrong but what you are suggesting is to use ShowFilterIcon="true", am I right? Those FilterIcons make the user chose a FilterFunction. I have all my FilterFunctions defined within <telerik:GridBoundColumn>.

 

What I want is simply to trigger filtering by pressing a simple <button> or a <asp:Button>. Is this possible?

0
Viktor Tachev
Telerik team
answered on 14 Sep 2015, 05:43 AM
Hello Käse,

In order to implement the functionality you can handle the client-side click event of the button control and call the filter() function for a given column.


Alternatively you can use server-side logic and modify the FilterExpression of RadGrid manually. Check out the following article that describes the approach in more detail.



Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
John Eptaminitakis
Top achievements
Rank 1
answered on 13 Jun 2019, 07:56 AM
I would have thought this would be a fairly common requirement i.e. don't post back on every filter selection, delay filtering until they click an apply button. The guidance above doesn't seem clear at all to me. Is there no better guidance on the easiest way to accomplish this?  
0
Eyup
Telerik team
answered on 17 Jun 2019, 01:48 PM
Hi John,

The grid provides the AutoPostBackOnFilter property and also the FilterDelay property, which are different functionalities:
https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx

Executing the filter option specifically on enter key is also an option and can be achieved using the following approach:
https://www.telerik.com/forums/force-a-filter-to-be-applied-on-enter-key#iAhKwV2sJk6XfuLfw7Dg-w

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Käse
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Käse
Top achievements
Rank 1
Viktor Tachev
Telerik team
John Eptaminitakis
Top achievements
Rank 1
Share this question
or