We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DockingManager loading from persisted state

Hi,

I saw this post: http://www.syncfusion.com/support/kb/tools/Default.aspx?ToDo=view&questId=9

But unfortunately I can not attach to this event, as loading from the persisted state ends up calling this in an infinite loop. Is there any other event I can attach to, or can you post a sample showing what the code should look like to acheive loading a persisted state with no user input??

Thanks,

Henry


3 Replies

FS Fathima Shalini P Syncfusion Team March 27, 2009 07:37 AM UTC

Hi Henry,

Thank you for your interest in Syncfusion Products.

The NewDockStateEndLoad event occurs immediately after a new dock state has been loaded. Whenever an application with one or more docked controls is loaded this event will be triggered more than once and this causes calling infinite loop when loading dock state. To avoid this we need to use the flag variable that allows the docking manager to load the docking state only once.

Kindly refer to the code snippet that illustrates this:


bool flag = false;
private void dockingManager1_NewDockStateEndLoad(object sender, EventArgs e)
{

if (flag == false)
{
flag = true;
this.dockingManager1.LoadDockState();
}
}


http://files.syncfusion.com/support/Tools.Windows/7.1.0.30/F80282/main.htm

Please let me know if any concerns.

Regards,
Fathima




HT Henry Thacker March 27, 2009 09:31 AM UTC

Unfortunately m_dockingManager_NewDockStateEndLoad never seems to get called for me... I have definitely attached the event, and I load several depersisted controls into the dockmanager when the form loads, but it still never fires.



MJ Mano J Syncfusion Team March 27, 2009 06:57 PM UTC

Hi Henry,

Can you try the Form's Shown event?


this.Shown += new EventHandler(Form1_Shown);
void Form1_Shown(object sender, EventArgs e)
{
// load the state here.
}


Best Regards,
Mano


Loader.
Live Chat Icon For mobile
Up arrow icon