RadToolBarButton Checked/Unchecked State Persistance

4 posts, 0 answers
  1. Ali
    Ali avatar
    24 posts
    Member since:
    Apr 2010

    Posted 24 Feb 2013 Link to this post

    RadToolBarButton Checked/Unchecked State Persistance:

    Hi,
    I need to save the Checked/Unchecked State of RadToolBarButton so that even the webpage is refreshed the state of RadToolBarButton persists or is preserved [May be server side or in a cookie]. Is there a built in functionality that I can use or how can I do it?

    <telerik:RadToolBarButton CommandName="Filter" PostBack="false" ToolTip="Search/Filter"
        CheckOnClick="true" AllowSelfUnCheck="true" Group="F">
    </telerik:RadToolBarButton>

    Thanks...
    The Team.
    http://www.megasearches.com/
  2. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 28 Feb 2013 Link to this post

    Hello.

    There are many ways you could do this:
    -- cookie is indeed one of them; to do so you need to plug to cookies from code behind;
    -- You could use the persistence framework to do so -- http://demos.telerik.com/aspnet-ajax/persistenceframework/examples/overview/defaultcs.aspx.
    -- Alternatively, you could use any custom solution.

    I am making a wild guess here, but if the toolbar button controls a setting that is applied to users, especially logged users, this setting should best be stored in a DB and extracted from there.

    Regards,
    Ivan Zhekov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ali
    Ali avatar
    24 posts
    Member since:
    Apr 2010

    Posted 28 Feb 2013 Link to this post

    Hi Ivan,
    Thank you very much for your reply. RadPersistenceFramework looks great and I definitely will be using it in the future. But for now I need a quick client-side solution and I don't need the states to be saved in a permanent storage [so, cookie seems to be ideal].

    I have a RadGrid and the RadToolBarButton named "Filter" (located in RadGrid's CommandItemTemplate) shows/hides the column filters of the Grid. But I don't want the filters to be shown always [initially the filters are hidden using javascript]. When user clicks on the RadToolBarButton the filters show up and user can use the filters in the RadGrid. But the problem is that when user checks the RadToolBarButton by clicking on it and searches the Grid Column using the filters, the RadGrid rebinds and all the filters gets hidden again.

    I need to keep the RadGrid's column filters shown/hidden depending on the state (checked/unchecked) of the "Filter" RadToolBarButton and save the states of RadToolBarButton in cookie.

    Similar to this example, rather than using radio button, I am using RadToolBarButton and want to save the state temporarily.
    http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx

    Do you have any example that uses cookie?

    Your help regarding this is highly appreciated.


  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 05 Mar 2013 Link to this post

    Hello,

    You could save the desired settings even if they are not persisted out of the box in the initial version of the Persistence Framework. This is shown in the example below:
    Custom Settings
    It is also possible to use custom storage provider that saves the settings in a cookie. I have attached a runnable demo to this thread.

    Best regards,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top