URGENT:how can i execute code in close event

2 posts, 0 answers
  1. sam
    sam avatar
    31 posts
    Member since:
    Jan 2008

    Posted 04 May 2008 Link to this post

    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

    }

    }


  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 06 May 2008 Link to this post

    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
Back to Top