Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Splitter / Client-side Events

P
a
n
e
1
P
a
n
e
2
P
a
n
e
3
Clear log Event log:

  • Client-Side Events

    RadSlidingZone client-side events:
    • OnClientLoad - raised when the initialization of the RadSlidingZone is complete.

    RadSlidingPane client-side events:
    • OnClientCollapsing - raised before the RadPane is collapsed.
    • OnClientCollapsed - raised when the RadPane is collapsed.
    • OnClientExpanding - raised before the RadPane is expanded.
    • OnClientExpanded - raised when the RadPane is expanded.
    • OnClientResizing - raised before the RadPane is resized.
    • OnClientResized - raised when the RadPane is resized.
    • OnClientDocking - raised before the RadPane is docked.
    • OnClientDocked - raised when the RadPane is docked.
    • OnClientUndocking - raised before the RadPane is undocked.
    • OnClientUndocked - raised when the RadPane is undocked.

    All client side events take two parameters - sender and arguments:
            function OnClientLoad(sender, args) 
            {
              //sender represents the slidingZone that has fired the event             //the code below obtains the id of the slidingZone that has fired the event             var id = sender.get_id();
    }

    All events that end in "ing" (i.e. OnClientResizing)" can be cancelled. To do this you should call the set_cancel(true) method in the event handler:

             function OnClientResizing(sender, args)
           {                           set_cancel(true);                        }
    Once, the OnClientResizing event is cancelled, the slidingPane cannot change its width and height.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="false" Inherits="Telerik.Web.Examples.Splitter.SP_ClientSideEvents.DefaultCS" %>

    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#"></qsf:Header>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

        <script type="text/javascript">
            /* RadSlidingZone events */
            function OnClientLoad(sender,args)
            {
                logEvent("SlidingZone with ID=" + sender.get_id() + " is loaded.");
            }

            /* RadSlidingPane events */
            function OnClientCollapsing(sender,args)
            {
                logEvent("Collapsing slidingPane with ID=" + sender.get_id() + ".");
            }
            
            function OnClientCollapsed(sender,args)
            {
                logEvent("Collapsed slidingPane with ID=" + sender.get_id() + ".");
            }
            
            function OnClientExpanding(sender,args)
            {
                logEvent("Expanding slidingPane with ID=" + sender.get_id() + ".");
            }
            
            function OnClientExpanded(sender,args)
            {
                logEvent("Expanded slidingPane with ID=" + sender.get_id() + ".");
            }
            
            function OnClientResizing(sender,args)
            {
                logEvent("Resizing slidingPane with ID=" + sender.get_id() + " with " + args.get_delta() + "px.");
            }
            
            function OnClientResized(sender,args)
            {
                var id = sender.get_id();
                var logMessage = "";

                var oldWidth = args.get_oldWidth();
                var width = sender.get_width();
                if(oldWidth != width)
                    logMessage += "Changed width of slidingPane with ID=" + id + " from " + oldWidth + "px to " + width + "px.";

                var oldHeight = args.get_oldHeight();
                var height = sender.get_height();
                if(oldHeight != height)
                    logMessage += "Changed height of slidingPane with ID=" + id + " from " + oldHeight + "px to " + height + "px.";

                logEvent(logMessage);
            }

            function OnClientDocking(sender,args)
            {
                logEvent("Docking slidingPane with ID=" + sender.get_id() + ".");
            }

            function OnClientDocked(sender,args)
            {
                logEvent("Docked slidingPane with ID=" + sender.get_id() + ".");
            }
            
            function OnClientUndocking(sender,args)
            {
                logEvent("Undocking slidingPane with ID=" + sender.get_id() + ".");
            }

            function OnClientUndocked(sender,args)
            {
                logEvent("Undocked slidingPane with ID=" + sender.get_id() + ".");
            }
        </script>

        <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="400" Width="750">
            <telerik:RadPane ID="LeftPane" runat="server" Width="22" Scrolling="None">
                <telerik:RadSlidingZone ID="SlidingZone1" runat="server" Width="22" OnClientLoad="OnClientLoad"
                    ClickToOpen="true">
                    <telerik:RadSlidingPane ID="Pane1" Title="Pane1" runat="server" Width="150" OnClientCollapsing="OnClientCollapsing"
                        OnClientCollapsed="OnClientCollapsed" OnClientExpanding="OnClientExpanding" OnClientExpanded="OnClientExpanded"
                        OnClientResizing="OnClientResizing" OnClientResized="OnClientResized" OnClientDocking="OnClientDocking"
                        OnClientDocked="OnClientDocked" OnClientUndocking="OnClientUndocking" OnClientUndocked="OnClientUndocked">
                        1
                    </telerik:RadSlidingPane>
                    <telerik:RadSlidingPane ID="Pane2" Title="Pane2" runat="server" Width="150" OnClientCollapsing="OnClientCollapsing"
                        OnClientCollapsed="OnClientCollapsed" OnClientExpanding="OnClientExpanding" OnClientExpanded="OnClientExpanded"
                        OnClientResizing="OnClientResizing" OnClientResized="OnClientResized" OnClientDocking="OnClientDocking"
                        OnClientDocked="OnClientDocked" OnClientUndocking="OnClientUndocking" OnClientUndocked="OnClientUndocked">
                        2
                    </telerik:RadSlidingPane>
                    <telerik:RadSlidingPane ID="Pane3" Title="Pane3" runat="server" Width="150" OnClientCollapsing="OnClientCollapsing"
                        OnClientCollapsed="OnClientCollapsed" OnClientExpanding="OnClientExpanding" OnClientExpanded="OnClientExpanded"
                        OnClientResizing="OnClientResizing" OnClientResized="OnClientResized" OnClientDocking="OnClientDocking"
                        OnClientDocked="OnClientDocked" OnClientUndocking="OnClientUndocking" OnClientUndocked="OnClientUndocked">
                        3
                    </telerik:RadSlidingPane>
                </telerik:RadSlidingZone>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="RadSplitbar1" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="EndPane" runat="server" />
        </telerik:RadSplitter>
        <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true" />
        <qsf:Footer runat="server" ID="Footer1"></qsf:Footer>
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451