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

Dynamically created Docks

2 Answers 89 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Roiy
Top achievements
Rank 1
Roiy asked on 04 Jun 2008, 01:22 PM
Hi
Im trying to create docks and I need some help.
my code :
RadDock aDock = ((IWidget)(auserControl)).GetWidget();  
                aDock.DockMode = DockMode.Docked;  
                aDock.AutoPostBack = true;  
                aDock.CommandsAutoPostBack = true;  
                  
                //Add closed command  
                DockCloseCommand dCC = new DockCloseCommand();  
                dCC.AutoPostBack = true;  
                aDock.Commands.Add(dCC);  
 
                //Add DockExpandCollapseCommand  
                DockExpandCollapseCommand dEC = new DockExpandCollapseCommand();  
                dEC.AutoPostBack = true;  
                aDock.Commands.Add(dEC);  
 
                aDock.DockPositionChanged += new DockPositionChangedEventHandler(aDock_DockPositionChanged);  
                aDock.Command += new DockCommandEventHandler(aDock_Command);  
                aDock.ID = widg.Id.ToString();  
                AsyncPostBackTrigger triger = new AsyncPostBackTrigger();  
                triger.ControlID = aDock.ID;  
                triger.EventName = "DockPositionChanged";  
                UpdatePanel1.Triggers.Add(triger);  
                switch (widg.ColumnNo)  
                {  
                    case 1:  
                        DockZoneLeft.Controls.AddAt(widg.OrderNo, aDock);  
                        break;  
                    case 2:  
                        DockZoneMid.Controls.AddAt(widg.OrderNo, aDock);  
                        break;  
                    case 3:  
                        DockZoneRight.Controls.AddAt(widg.OrderNo, aDock);  
                        break;  
                } 
 thats work fine
the part that i need help is this
void aDock_Command(object sender, DockCommandEventArgs e)  
        {  
        }  
 void aDock_DockPositionChanged(object sender, DockPositionChangedEventArgs e)  
        {  
              
        } 
each time the user move/remove/expand/collaps the dock i need to save it in the DB so in  aDock_DockPositionChanged   i need the radock id (i have the e.dockzonid and e.index for location)
and in aDock_Command i need the radock id and if the action is expand or collaps.
i cant get it from e or sender ,any other idea?

Thanks
Roiy

2 Answers, 1 is accepted

Sort by
0
Accepted
Sophy
Telerik team
answered on 05 Jun 2008, 08:45 AM
Hi Roiy,

In both handlers (aDock_Command and aDock_DockPositionChanged) the first parameter - object sender is the corresponding dock which has raised the event. You can find the id of the dock in the following way:
string id = ((Control)sender).ID;
You can take a look the the AutoPostBack online example for reference.
If you need further assistance, do contact us again.

Best wishes,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Accepted
Roiy
Top achievements
Rank 1
answered on 05 Jun 2008, 08:48 AM
Thanks
Tags
Dock
Asked by
Roiy
Top achievements
Rank 1
Answers by
Sophy
Telerik team
Roiy
Top achievements
Rank 1
Share this question
or