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
65
UltraDockManager Pin/Unpin and close button in the tabs
posted

Hello,

I've tried to search a forum, but couldn't find any quick and easy solution/answerr:

the case is that in our app one type of panes (1) cannot be closed - should always be opened, so user can only pin/unpin it (i.e navigation pane, or some 'control' pane for specific tasks), the second panes type (2) are opened when user i.e double click an object to see some details - and those panes can be closed

for (1) when user undock it as floating window, it should only be possible to dock it back to the main dock area, not close

for (2) it should be possible to close it and pint it back.

also what is the proper way to close the pane - I mean dispose it and control inside also, not hide ?

We also do not want to show captions, so the question is how to show the pin/unpin button in the tab and in floating window - or how to handle close button so (1) type will be docked back and (2) will be closed ?

the only thing I have found is really old solution to create custom button in IUIElementCreationFilter 

BR

Kris

Parents
  • 34430
    Offline posted

    Hello Kris,

    I have been investigating into the behavior you are looking to achieve in this case, and I have some information for you. The below responses will be in the order of the inquiries you have provided:

    1. Allowing Closing: You can allow or disallow closing of a pane by setting the Settings.AllowClose property on the underlying DockableControlPane. You can use the following code for this, where “pane1” is a DockableControlPane:

    pane1.Settings.AllowClose = Infragistics.Win.DefaultableBoolean.False;

    2. Disposal: When a pane’s close button is pressed, it will be hidden or “Closed” in this case, but it and its control will still be a part of the UltraDockManager. If you want to completely dispose of it, you can handle the PaneHidden event of the UltraDockManager. The event arguments of this event will get you the pane that was hidden, and you can take actions on it. For example, if you want to remove it completely, you can call Dispose() on it, as well as removing it from its Parent DockAreaPane.Panes collection.

    3. Floating Window Button Handling / Pin Button: The pin button will not show on a floating window because for a pane to be pinned or unpinned, it first needs to be docked, and so if you are looking to achieve this, an IUIElementCreationFilter likely would be the best bet. That said, if you are looking to do the alternative where you handle the close button, this is possible.

    The best thing I can recommend to handle the close button is to handle the BeforePaneButtonClick event, as this event is cancellable and also returns you the button that you clicked. If you find that the e.Button is PaneButton.Close, you can call e.Pane.Dock(true); (where ‘e’ is the event arguments). This will return the pane back to its previous state. Then, you should be able to set e.Cancel = true to prevent any action that normally would happen by clicking the Close button to handle the Close button click.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

Reply Children
No Data