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.
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.
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.
if user closes RadPane with click on X, I want to delete toggle button for this RadPane.