
I will explain you of what I am tryin to do and how I want it to work.
I do have a default page where I am adding dynamically controls (in raddocks)
like in your samples and want to add a custom command which will open me a window not yours an open window. In open window I am getting all the data (configuration) of Specific raddock control which is sent by session.
In edit window i change the data and make click on the button which is inside the raddock(ex: raddock has some news.ascx control which has some hidden button).
By clicking this hidden button I want it to save the changes and make a dopostback.
In all your samples you do have only two events added dynamically the dragging and closing the dock. I want to add to the triggers this button event as well for updating the data.
Thank you in advance.
4 Answers, 1 is accepted

If you use the following example(MyPortal):
http://demos.telerik.com/ASPNET/Prometheus/Dock/Examples/MyPortal/DefaultCS.aspx
The code below is modified part of MyPortal example illustrates how to add custom ajaxified command:
private RadDock CreateRadDock() |
{ |
int docksCount = CurrentDockStates.Count; |
RadDock dock = new RadDock(); |
dock.UniqueName = Guid.NewGuid().ToString(); |
dock.ID = string.Format("RadDock{0}", dock.UniqueName); |
dock.Title = "Dock"; |
dock.Text = string.Format("Added at {0}", DateTime.Now); |
dock.Width = Unit.Pixel(300); |
//YOUR CUSTOM COMMAND |
DockCommand command = new DockCommand(); |
command.AutoPostBack = true; |
command.Name = "CustomCommand"; |
dock.Commands.Add(command); |
//END:YOUR CUSTOM COMMAND |
dock.Commands.Add(new DockCloseCommand()); |
dock.Commands.Add(new DockExpandCollapseCommand()); |
dock.Command += new DockCommandEventHandler(dock_Command); |
return dock; |
} |
void dock_Command(object sender, DockCommandEventArgs e) |
{ |
if (e.Command.Name == "Close") |
{ |
ScriptManager.RegisterStartupScript( |
UpdatePanel1, |
this.GetType(), |
"RemoveDock", |
string.Format(@"function _removeDock() {{ |
Sys.Application.remove_load(_removeDock); |
$find('{0}').undock(); |
$get('{1}').appendChild($get('{0}')); |
$find('{0}').doPostBack('DockPositionChanged'); |
}}; |
Sys.Application.add_load(_removeDock);", ((RadDock)sender).ClientID, UpdatePanel1.ClientID), |
true); |
} |
//HANDLE CUSTOM COMMAND |
if (e.Command.Name == "CustomCommand") |
{ |
//DO SOMETHING... |
} |
} |
Hope this helps!

I don't need a command itself. I want somehow to change the visual side of the raddock when I click some button in the user control which is inside the raddock contol.
Example: I do have some iframe in the user control which recieves the url of some web site to be shown. I add some raddock command which opens a new window. In that window I recieve as a parameter the url of that iframe. Change it and click OK in the edit window. The data is saved in session.
From opened window I make a click on some hidden button inside the control and want the data to be refreshed inside the raddock.
As I see the initialization of raddocks should be done only during the page_init. And I think it should in the same manner as you have discribed above I mean after making the click in user control and making update in the database there should be a postback for initializing the control once more.
How is it done??? Cause you do all these postback via java script. Thanks in advance.

here is a code of Hidden Button Click.
This is a way how I see it and it is not correct :(
protected void hiddenButton_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(
MyDock,
this.GetType(),
"RefreshDocking",
string.Format(@"function _RefreshDock() {{" +
"Sys.Application.remove_load(_RefreshDock);" +
"$find('{0}').doPostBack('DockPositionChanged');" +
"}};" +
"Sys.Application.add_load(_RefreshDock);", MyDock.ClientID),
true);
}
DockPositionChanged as I see is an event which should be called or my one for making update.
At this stage I recive all the data I need and I want only to make update to raddock.
MyDock I recive as a property from default.aspx.cs so i would be happy to see the answer.

Keep in mind that the hidden button should be in the same document as the RadDock, e.g. if you put the button in iframe(or Radwindow) you will not be able to update the RadDock.
The code which you sent seems to be correct.The only one suggestion which I can give you is to invoke "alert('{0}');" Instead "$find('{0}').doPostBack('DockPositionChanged');" and see if the ID is correct.