Get all RadDocks in RadDockZone in Codebehind

2 posts, 0 answers
  1. Michael
    Michael avatar
    43 posts
    Member since:
    Mar 2013

    Posted 30 Jul 2013 Link to this post

    I have a series of dynamically created raddocks, that are dynamically placed in different RadDock zones. If the user presses "Save" I am trying to cycle through each raddockzone and then save information from them in a database. See below.

    private void SaveWorkspacePanels(RadDockZone dockzone,int workspaceid,int panellocation)
                BusinessLayer BL=new BusinessLayer();
                DemandSolutions_WorkspacePanel WorkspacePanel;
                string source;
                string [] parsed;
                string panelid;
                string paneltype;
                foreach(RadDock dock in dockzone.Docks)
                    WorkspacePanel=new DemandSolutions_WorkspacePanel();
                    parsed=source.Split(' ');
                }//End For-Each
            catch(Exception ex)
                DisplayMessage.InnerText="Problem with "+dockzone.ID+" "+ex.ToString();
        }//End Function

    The problem is if the RadDock is moved from another dockzone, it is not detected and therefor not saved...any thoughts.

    Here is how the RadDock is created

    RadDock dock=new RadDock();
    dock.DockMode = DockMode.Docked;
    dock.ID= string.Format("RadDock{0}", Guid.NewGuid().ToString().Replace('-', 'a'));
    dock.Tag=panelID+" "+controlType;
    dock.Commands.Add(new DockExpandCollapseCommand());

  2. Slav
    Slav avatar
    1359 posts

    Posted 02 Aug 2013 Link to this post

    Hi Michael,

    It is possible that you are saving the information before the Docks collection of RadDockZone is updated after the RadDock is dragged. Please check this helps article. The dock state is ready to be saved anywhere after Page.Load so I would suggest executing your logic after this event, preferably on RadDockLayout.SaveDockLayout, which is designed for this purpose.

    If you are saving the information from the docks in order to persists their layout, you can use the approach shown in this online demo.

    In case you are still having difficulties after examining the information above, please open a support ticket and send a simple, fully runnable project that isolates your logic so that I can inspect it locally and provide a more to the point answer.

    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 the blog feed now.
Back to Top