How to raise a Postback on filter manually?

6 posts, 0 answers
  1. Käse
    Käse avatar
    2 posts
    Member since:
    Sep 2015

    Posted 01 Sep 2015 Link to this post

    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!

  2. Eyup
    Admin
    Eyup avatar
    3867 posts

    Posted 03 Sep 2015 Link to this post

    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
  3. Käse
    Käse avatar
    2 posts
    Member since:
    Sep 2015

    Posted 09 Sep 2015 in reply to Eyup Link to this post

    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?

  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2396 posts

    Posted 14 Sep 2015 Link to this post

    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
  5. John Eptaminitakis
    John Eptaminitakis avatar
    3 posts
    Member since:
    Sep 2012

    Posted 13 Jun Link to this post

    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?  
  6. Eyup
    Admin
    Eyup avatar
    3867 posts

    Posted 17 Jun Link to this post

    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.
Back to Top