Initialize RadDock when opened

2 posts, 1 answers
  1. JP
    JP avatar
    120 posts
    Member since:
    Aug 2011

    Posted 23 Aug 2011 Link to this post


    I have a RadListBox embedded into a RadDock. When the RadDock is opened (MyRadDock.Closed = false), I want to clear
    the RadListBox.
    At the moment, when the RadDock is closed and opened again, the ListBox still contains the items from the previous command call.

    Unfortunately I don't find an event which is fired when the RadDock is opened. The client-side event "OnClientInitialize" is also called on PostBack but I want to preserve the ListBox content during a PostBack (which currently works fine) when the RadDock is opened.

    Do you have any idea how I can clear the RadListBox every time the RadDock is opened but not on a PostBack?


  2. Answer
    Slav avatar
    1351 posts

    Posted 25 Aug 2011 Link to this post

    Hello Jan-Patrick,

    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 >>

  3. DevCraft R3 2016 release webinar banner
Back to Top