If I understand correctly your request, you want to clear the RadListBox when the RadDock is closed, and then to populate it with data again when the RadDock is opened, but only if it has been already closed and not on every PostBack.
You can clear the RadListBox on the OnCommand
event of the RadDock. In the handler of this event you can check whether the close button has been clicked and if it is so, you can clear the RadListBox.
You won't need event, fired when the RadDock is opened, in order to bind new items to the RadListBox. You can achieve this from the place in your code, where the RadDock is being opened. For example, if you use a button to open the dock, on that button's Click
event you can set new items for the RadListBox.
In order to visualize my point, I have attached a sample project, demonstrating the described implementation. You may use it as a reference to incorporate the feature into your actual project.
I hope the presented solution meets your requirements. Pleas let us know if you are still experiencing problems with implementing the desired functionality.
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>