Rad dock disappears on custom command

4 posts, 0 answers
  1. Nonu
    Nonu avatar
    14 posts
    Member since:
    Apr 2007

    Posted 16 Aug 2007 Link to this post

    I am creating a Raddock at button click. I need to create a custom command & bind it to a method.
    I am using the following command. It is posting back to the server but not firing "dock_Command" function. My Raddock also disappears after post back.
    dck_Main.Command += new DockCommandEventHandler(dock_Command);


  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 16 Aug 2007 Link to this post

    Hello Nonu,

    I modified a bit our Dynamic Docks example where docks are dynamically created to add a custom command and handler for the Command event. Everything works as expected. Please, take a look at it and try to follow its logic in your project. Your dock disappears after a postback because most probably you do not recreate it in Init every time - you should do so when adding controls dynamically. If you continue to experience the same problem, please send us a running project simplified to the greatest extent just reproducing the issues with the docks and we will try to provide more specific guidance.

    Greetings,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. dotnetuncle
    dotnetuncle avatar
    5 posts
    Member since:
    Jul 2007

    Posted 16 Aug 2007 Link to this post

    Hi Petya

    We tried to work with your approach. But here, again the dynamically created raddock object is created in the Init event. 

    In our case we have to create the dock object at runtime on AjaxRequest event and need to attached the event handler for the custome command at runtime. But the event does not trigger. Please suggest.
  4. Petya
    Admin
    Petya avatar
    869 posts

    Posted 17 Aug 2007 Link to this post

    Hello dotnetuncle,

    I feel that I need to explain a bit more about the specifics of creating a dock dynamically and provide some more details about the example I sent you before. In my example when you click Add Dock a dock is created in button click and this process is ajaxified. So far I believe this is what you are trying to achieve. This dock is created and a custom command is created whose handler executes fine. And here comes the important part - you need to recreate this dock in Page Init otherwise you won't have the dock on your page after a postback occurs. For the proper work of RadDock thsi recreation should take place in Init, not in PageLoad.

    Please, take this information into consideration, and if you continue to experience problems, just send us a simple running page demonstrating what you try to achieve and we will work on it.

    Best wishes,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top