Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
955
What is the best way to avoid duplicate pane addition.
posted

Hello,

I am using 2009.2 and programmatically adding new content pane to the dock manager via AddDocument method.

I would like to know the best way to avoid creating duplicate pane with same header. i.e., I have a list box with 3 items and have 3 corresponding document content panes. Now when reselecting an item in the list box, I would like to activate the already opened pane (irrespective of it is docked or floating, etc.,) instead of creating a new one.

Please clarify on how to implement this request

Thanks,

Muthu

 

Parents
  • 955
    posted

    It appears that below routine works, but is the approach or any direct APIs avilable on dockManager to identify if cotentpane of the given header exists or not?

             foreach (var pane in dockManager.GetPanes(Infragistics.Windows.DockManager.PaneNavigationOrder.ActivationOrder))
            {
                if (pane.Header.Equals(header))
                {
                    paneExists = true;
                    pane.Activate();
                    break;
                }
            }

            if (!paneExists)
            {
                var recordDisplayPane = dockManager.AddDocument(header, grid);
                recordDisplayPane.Activate();
            }

Reply Children
No Data