Saving Multiple Dock States

2 posts, 0 answers
  1. Carolus
    Carolus avatar
    8 posts
    Member since:
    Apr 2009

    Posted 07 May 2009 Link to this post

    I have successfully saved the dock state into a database, howver this occurs without any user interaction, so the dock state constantly saves even if the user doesn't want to save the state. I have looked through the Examples on the site, however I see nothing about saving the state with a Button Click. For example:

    DockName: MyCoolDockLayout
    Button: Save 

    Database Table: Userid,DockName,DockLayout

    I have been trying to Raise the  Telerik.Web.UI.DockLayoutEventArgs with a button click but I get Event Argument Errors. How can I get the DockLayoutEventArgs to pass through a Button Click Event, to then Trigger the RadDockLayout_SaveDockLayout Sub?

    Thanks...
  2. Obi-Wan Kenobi
    Obi-Wan Kenobi  avatar
    460 posts
    Member since:
    Aug 2007

    Posted 11 May 2009 Link to this post

    You could use a flag which will indicate if the user is pressed save button or not. If the user is pressed the button then the state will be saved, e.g.

    bool

     

    isButtonSaveStateClicked = false;

     

    ...

     

    protected void btnSaveState_Click(object sender, EventArgs e)

     

    {
        isButtonSaveStateClicked = true;

     

    }

    ....

     

    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)

     

    {

         if(isButtonSaveStateClicked == true)
            {
                ...SaveState here
            }
    }


Back to Top