Hi all,
I want to set the initial state of a radCollapsiblePanel to expanded or collapsed. Then, I want to associate an event handler to handle user interaction that can expand or collapse the panel. I perform some operations to set the initial state. When I attach the event handler for the collapsed state, the event is triggered even if the user has not interacted with the panel.
I don't understand why.
Suggestions
Regards
Alessandro
After looking at the Telerik control source code, I found the problem. The OnCollapsed event is sent when the collapse/expand animation completes. So if you set the isExpanded property to false in your application and after that you set eventhandler for "Collapsed" for example:
//not working (the PnlCollassabile_CollapsedExpanded handler is called even if is set *after* the initial collapse by code collapsiblePanel.IsExpanded = false; collapsiblePanel.Collapsed += PnlCollassabile_CollapsedExpanded; //it works because i'm waiting the animation to complete collapsiblePanel.IsExpanded = false; while (collapsiblePanel.IsAnimating) await Task.Delay(100); collapsiblePanel.Collapsed += PnlCollassabile_CollapsedExpanded;
hope is useful for others
Regards
Hello, Alessandro,
It seems that you have already found how to accomplish the desired behavior that you would like to have with RadCollapsiblePanel. Thank you for sharing your solution with the community!
In case you have any other questions do not hesitate to contact us.