This is a migrated thread and some comments may be shown as answers.

[Solved] Rad dock disappears on custom command

3 Answers 186 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Nonu
Top achievements
Rank 1
Nonu asked on 16 Aug 2007, 01:54 PM
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);


3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 16 Aug 2007, 03:47 PM
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
0
dotnetuncle
Top achievements
Rank 1
answered on 16 Aug 2007, 05:10 PM
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.
0
Petya
Telerik team
answered on 17 Aug 2007, 07:08 AM
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
Tags
Dock
Asked by
Nonu
Top achievements
Rank 1
Answers by
Petya
Telerik team
dotnetuncle
Top achievements
Rank 1
Share this question
or