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

URGENT:how can i execute code in close event

1 Answer 56 Views
Dock
This is a migrated thread and some comments may be shown as answers.
sam
Top achievements
Rank 1
sam asked on 04 May 2008, 08:39 AM
Hi Team
can i execute a code when user clicks on close i tryied to set my code under the following event but its not work since i add this in my HTML

<Commands>

<cc1:RadDockableObjectCommand Enabled="true" Name="Close" ToolTip="Expand" />

</Commands>



protected

void rdObject_Command(object sender, EventArgs e)

{

if (rdObject.Closed)

{

my code

}

}


1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 06 May 2008, 09:43 AM
Hello sam,

I recommend to use the DockCloseCommand as shown below:

   <telerik:RadDock ID="RadDock1" runat="server" Width="300px" Height="200px">  
                <ContentTemplate> 
                    This is the RadDock  
                </ContentTemplate> 
                <Commands> 
                    <telerik:DockCloseCommand OnClientCommand="OnClose" /> 
                </Commands> 
            </telerik:RadDock> 

 function OnClose(sender, eventArgs)  
    {  
      alert("The close event was fired!");  
    } 

I prepared a sample project for your convenience - you can find it in the attachment.


Regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
sam
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or