Contact Sales: +1-888-365-2779
Community & Support
Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Docking > Hooking the Expand/Collapse event.
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Hooking the Expand/Collapse event.

Feed from this thread
  • Chris Holmok avatar

    Posted on Aug 21, 2006 (permalink)

    Is there a way (either server-side, or preferably client-side) to hook the the expand/collapse event of dock object?  I want to save it's expanded/collapsed state in the user's profile in ASP.NET 2.0. 

    Thanks.

  • Petio Petkov Petio Petkov admin's avatar

    Posted on Aug 21, 2006 (permalink)


    Hello Chris,

    You must add the Collapse and Expand commands. After that, you must set their  AutoPostBack property to true.

    <radDk:RadDockableObject ID="RadDockableObject1" runat="server" Text="1" OnCommand="RadDockableObject1_Command">  
                <Commands> 
                    <radDk:RadDockableObjectCommand AutoPostBack="True" Enabled="False" Name="Expand"  ToolTip="Expand" /> 
                    <radDk:RadDockableObjectCommand AutoPostBack="True" Name="Collapse"  ToolTip="Collapse" /> 
                </Commands> 
            </radDk:RadDockableObject> 

    Also you must add a handler in code behind to the RadDockableObject  (OnCommand="RadDockableObject1_Command)

    and do something in code behind:

       protected void RadDockableObject1_Command(object sender, EventArgs e)  
        {  
           //doSomething  
        } 



    Best regards,
    Petio Petkov
    the telerik team

  • Posted on Sep 10, 2006 (permalink)

    Hello,

    As you might have noticed, I've been working with the Docking stuff this weekend.  Cool stuff, by the way!

    Is there a way to do a Client-Side event here?

    When a user makes a change to the layout of their page, I'm making a link to save their changes visible (which was, of course, previously hidden).  I'd like to make this link available for when someone expands or collapses a window, too.  I don't want to do a postback.

    I can probably just make this link always visible, and I might go that route, but I'd like to see if this is possible, first.

    Thanks.
    --Barry

  • Petio Petkov Petio Petkov admin's avatar

    Posted on Sep 11, 2006 (permalink)


    Hi Barry,

    You must add onclientcommand="showlink" to expand and Collapse commands:
      <radDk:RadDockableObjectCommand  Name="Collapse"  ToolTip="Collapse" onclientcommand="showLink"/> where showlink function will show the link using javascript.
    A simple example using custom commands and handling client side events, you can find at:
    http://www.telerik.com/r.a.d.controls/Dock/Examples/Commands/DefaultCS.aspx

    All the best,
    Petio Petkov
    the telerik team

  • Vic avatar

    Posted on May 6, 2008 (permalink)

    If you are having issues with the EventArgs e, cast it to its correct type:
    protected void RadDockingZone1_OnCommand(object sender,  EventArgs e)  
    {  
        RadDockableObjectCommandEventArgs e2 = e as RadDockableObjectCommandEventArgs;  
     
        switch (e2.Command.Name)  
        {  
            case "Expand":  
            //Do something  
                break;  
        }  
    }  

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Docking > Hooking the Expand/Collapse event.