Differentiate how the RadPane was closed

0 Answers 89 Views
Docking
Sergej
Top achievements
Rank 1
Sergej asked on 16 Jan 2023, 09:26 AM | edited on 16 Jan 2023, 11:38 AM

Hello,

Is it possible to differentiate whether the user closed the RadPane (click on X in header of RadPaneGroup or ToolWindow) or whether it was closed programmatically (IsHidden=true)?

Best regards

Martin Ivanov
Telerik team
commented on 18 Jan 2023, 11:41 AM

To listen for RadPane closing via the X button or the IsHidden property, you can use the Close or PreviewClose events of RadDocking. However, there isn't a method to distinct how the pane was closed. If you tell me why do you need this information, I can think of some alternative.
Sergej
Top achievements
Rank 1
commented on 19 Jan 2023, 08:30 AM

My app has a toggle buttons in status bar. They are used to hide/show RadPanes (for every RadPane one Button)
if user closes RadPane with click on X, I want to delete toggle button for this RadPane.
Martin Ivanov
Telerik team
commented on 19 Jan 2023, 01:45 PM

To achieve your requirement, you can override the RadDockingCommands.Close command. In the new methods, you can manually close the pane. This will is also the place where you can execute your extra code that deletes the toggle button. You can find this idea in the attached project. I hope it helps.

No answers yet. Maybe you can help?

Tags
Docking
Asked by
Sergej
Top achievements
Rank 1
Share this question
or