Load & Persist C1DockControl Items with same ratio

Posted by: vinothkumar.r2210 on 25 May 2020, 12:26 am EST

  • Posted 25 May 2020, 12:26 am EST

    Hi,
    I want to retain my previous session (i.e. dockcontrol with same number of items and with same ratio) in next time opening the application.
    To achieve above scenario, I did the following
    1.I have saved C1DockControl items using C1DockControl.Save() method. It returned C1DockSetting and saved C1DockSetting.Root as XML.
    2. I read the XML file and loaded XElement in dockControl.Load() method. It loaded all items with same position.

    But the problem is, Items are not loaded with same ratio when it was in the ratio before saved.

    Scenario 1: When I am starting the Window with Maximized state and adding items in DockControl and saving the session with same Maximized state. By next time I am starting the window with normal state,the items are loaded with same and ratio its working fine.

    Scenario 2: When I am starting the Window with Normal state and adding items in DockControl and saving the session with same Normal state. By next time I am starting the window with Maximized state,the items are not loaded with same.

    Please find the attached image and code sample.
    Thanks and Regards,
    Vinoth Kumar Ravi

  • Replied 25 May 2020, 12:30 am EST

    Hi,

    Forgot to add attachments. Please find the attachments for the same.DockingSamples.zip

    Thanks and Regards,
    Vinoth Kumar Ravi
  • Replied 25 May 2020, 11:06 pm EST

    Hi Vinoth,

    I have tested the provided sample and observed the same behavior in both scenarios with Build 2020v1 (4.5 version). Please refer to the attached videos for the same.

    Could you please elaborate a bit more on how the two scenarios are different and what exactly you are expecting in scenario two?

    Regards,
    Basant
  • Replied 25 May 2020, 11:19 pm EST

    PFA

    ~Basant

    Docking.zip
  • Replied 28 May 2020, 7:32 pm EST

    Hi Basant,

    Thanks for the reply. I have gone through the videos. If I am not wrong I think you missed out one step. Once you done your docking changes you should close your window and start again.

    Please follow below step.
    Scenario 2: Open Window with normal state and add dockcontrols and close it without maximizing it. When closing the layout changes will get saved in local. By next time open window with Maximized state. Then we have check whether it maintains same ratio or not.

    Thanks and Regards,
    Vinoth Kumar Ravi
  • Marked as Answer

    Replied 28 May 2020, 11:42 pm EST

    Hi Vinoth,

    I have repeated the same steps as you were saying. The steps for closing and reopening (after changing the window's Maximized state) the application were skipped in videos for keeping the them short.

    Even in the images that you shared I don't see any mismatch in the ratio. The width and height of items seems to be adjusted correct as per the window's changed size.

    Could you please correct me if I am misinterpreting the ratios or If you could mark in the image what should have the item's new size as per you?

    Regards,
    Basant
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels