We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Docking Panel Close/Hide Button Event?

Hi, how can i raise an event when i click the close button (X) of a docking panel?

Thanks, David.

6 Replies

DA David June 30, 2009 05:40 PM UTC

OK, i have found the click event of this.dockingManager1.CaptionButtons["CloseButton"] and i can successfully raise this event when i close a panel.

Only problem now is, how can i tell which panel i closed or how can i get the name of the docked control that was closed?


DA David July 1, 2009 10:24 PM UTC

Ok, scrap what i asked for, what i actually need is a way of raising an event when a docked control is set to "Hide", not just using the close button, but also by selecting hide from the context menu.

Anyone?


FS Fathima Shalini P Syncfusion Team July 2, 2009 12:50 PM UTC

Hi David,

Thank you for your interest in Syncfusion Products.

When closing the DockedPanel using close button or using ContextMenu, DockVisibilityChanging and DockVisibilityChanged event. Using the event's Control property we can easily trace out the control being closed. Kindly refer to the provided documentation links that depicts this:

http://help.syncfusion.com/ug_72_new/toolswin/HowToPreventClosingOfDockedWindow.html

http://help.syncfusion.com/ug_72_new/toolswin/DocVisibilityChangedEvent1.html

Please let me know if any concerns.

Regards,
Fathima


DA David July 2, 2009 11:55 PM UTC

I can't get it to work, it seems that the DockVisibilityChanged event never gets fired. I tried calling a simple MessageBox, but it still doesn't work when i click the "close" button or press "hide" from the contextmenu.

I have no idea why this event doesn't work.

I've also tried using other events like AutoHideAnimationStart, and i still can't get it to fire. It seems that the dockingmanager isn't responding to events?

Is this a bug or something?


DA David July 3, 2009 12:10 AM UTC

Seems that the events only get fired when I add the eventhandler within the BeginInit() and EndInit() statements. It doesn't seem to work when i just add them using the Events panel in the properties window.

Anyway thanks for your help.


FS Fathima Shalini P Syncfusion Team July 6, 2009 11:54 AM UTC

Hi David,

Thank you for your update.

I tested the issue with the simple sample in which I have docked two panels and added event handlers using properties window at design time. I could see DockVisibilityChanged and DockVisibilityChanging events triggered when closing the docking control both by clicking the close button and using Hide option.

http://files.syncfusion.com/support/Tools.Windows/7.2.0.37/F84415/main.htm

Please let me know if any concerns.

Regards,
Fathima

Loader.
Live Chat Icon For mobile
Up arrow icon