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
505
tabbedGroupPane.Items and floating pane; ContentPane vs ContentPanePlaceHolder??
posted

Hello,

 

I have a tabbed group pane and  I have logic where I check foreach contentPane in the tabbedgrouppane and apply some operations.

foreach (ContentPane _pane in baseTabGroup.Items)

                {

                    if (_pane.Tag != null)

                    {

                        if ((int)_pane.Tag == e.Patient)

                        {

                            patient = _pane;

                            break;

                        }

                    }

                }

 

This logic works fine if I have all the panes docked. But, if I have any of the pane floating I get an exception.

Can anyone help me please?

Thanks,

Uday Thummalapalli

  • 54937
    Verified Answer
    Offline posted

    You cannot assume that the items are ContentPane instances. When the pane is put into the alternate dock state (floating if it was docked) then a ContentPanePlaceholder is put there. Note you really shouldn't rely on panes being in a specific container. Assuming you're not preventing this, the end user can dock the pane elsewhere in which case nothing is left in the previous parent. The ContentPanePlaceholder is really just there as a placeholder for a docked state where the item should be when it is in that state again (e.g. when you toggle the docked state from floating to docked by double clicking on the caption of a floating pane).