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 / First Look

RadSplitter


RadSplitter also creates separate regions for displaying content to users. Unlike RadWindow and RadDock, however, the content regions that RadSplitter uses are not pop-up windows. Instead, they are resizable frames, called panes, that divide up a region of the Web page. The splitter can be configured to lay out its panes either horizontally or vertically. By adding split bars between the panes, you can enable the user to resize panes in the browser. Alternately, you can leave out the split bars, to create a static layout of separate panes on your Web page. In a splitter that contains split bars, individual panes can be "locked", so that they are not resizable along with the other panes of the splitter.

Panes can display content from an external URL, like RadWindow, or content that is loaded with the Web page, like RadDock. The screenshot below shows a splitter that displays a radio button list that is loaded with the Web page in the left pane, and content from an external Web site in the right pane:

Panes that load their content with the Web page can hold any HTML elements, even another splitter. By nesting splitters with alternating horizontal and vertical orientations, you can create arbitrarily complex layouts.




RadSlidingZone


RadSlidingZone is a specialized control for optimizing layout that can only be placed directly inside the pane of a splitter. RadSlidingZone implements a set of tabs that can be used to slide out additional panes, called sliding panes, similar to the way Visual Studio lets you slide out panels such as the Properties Window or Solution Explorer. Like the sliding panels in Visual Studio, the sliding panes of a RadSlidingZone control can be docked in place by the user. By defining sliding panes in a sliding zone container, you can initially hide content that your users do not need to see all the time.

You can configure the orientation of the sliding zone and whether sliding panes expand when the user moves the mouse over their tabs or whether the user must click on a tab to expand it. Individual tabs can be configured to display text, an icon, or both. Sliding panes can be fixed in size, or resizable in the direction that they expand. You can also suppress the ability of the user to dock individual sliding panes.




Getting Started

In this walk-through you will become familiar with the following "real estate" controls:

  • RadDockZone and RadDock
  • RadSplitter, RadPane, and RadSplitBar
  • RadWindowManager and RadWindow

These controls will be used to generate the layout shown in the following screen shot:




Set up the project structure

  1. Create a new ASP.NET Web Application.
  2. Drag a ScriptManager from the Tool Box onto the Web page.



Add the RadSplitter controls

  1. Drag a RadSplitter control from the Tool Box onto the right-hand cell of the table.
  2. Using the Smart Tag, set its Skin property to "Outlook".
  3. Using the Properties Window, set the Orientation property to "Horizontal" and the Width to "100%"
  4. Drag a RadPane control from the Tool Box onto the surface of the RadSplitter. Set its Height property to "75px".
  5. Drag a LinkButton from the Tool Box onto the surface of the RadPane control. Set its Text property to "Telerik".
  6. Hit the Enter key to add a line break after the link button, and add a second LinkButton below the first. Set this one's Text property to "Google".
  7. Hit the Enter key again and add a third LinkButton. Set its Text property to "Wikipedia".
  8. Drag a RadSplitBar control from the Tool Box onto the surface of the RadSplitter, below the RadPane you just filled. This can be a little tricky, so feel free to use the Source view to move it into place if you need to.
  9. Drag a second RadPane control onto the RadSplitter. Once again, this can be a bit tricky, so check in the Source view to make sure that it landed in the right place. At this point, your RadSplitter declaration should look like the following:
[ASP.NET] RadSplitter declaration
< telerik:RadSplitter ID = "RadSplitter2" runat = "server" Orientation = "Horizontal" Skin = "Outlook"
     Width = "100%" >
     < telerik:RadPane ID = "RadPane2" runat = "server" Height = "75px" >
         < asp:linkbutton id = "LinkButton1" runat = "server" >Telerik</ asp:linkbutton >
         < br />
         < asp:linkbutton id = "LinkButton2" runat = "server" >Google</ asp:linkbutton >
         < br />
         < asp:linkbutton id = "LinkButton3" runat = "server" >Wikipedia</ asp:linkbutton >
     </ telerik:RadPane >
     < telerik:RadSplitBar ID = "RadSplitBar3" runat = "server" />
     < telerik:RadPane ID = "RadPane3" runat = "server" >
     </ telerik:RadPane >
</ telerik:RadSplitter >



Add the RadWindowManager and RadWindow controls

  1. Drag a RadWindowManager control from the Tool Box and place it at the bottom of the Web page.
  2. Using the Properties Window, set the Skin property to "Outlook".
  3. Press the ellipsis button next to the Windows property to bring up the RadWindow Collection Editor.
  4. In the Collection Editor, click the Add button to add a RadWindow to the RadWindowManager's Windows collection.
  5. Assign the following properties to the new window you just added:
    • Set Animation to "Fade".
    • Set Behaviors to "Resize, Minimize, Close, Maximize, Move, Reload".
    • Set OpenerElementID to "LinkButton1".
    • Set Title to "Telerik".
    • Set VisibleStatusBar to false.
    • Set NavigateUrl to "http://www.telerik.com". As before, be sure to include the entire URL.
  1. Click the Add button again to add a second RadWindow to the collection. Set the following properties:
    • Set Animation to "FlyIn".
    • Set Behaviors to "Resize, Minimize, Close, Maximize, Move, Reload".
    • Set OpenerElementID to "LinkButton2".
    • Set Title to "Google".
    • Set VisibleStatusBar to false.
    • Set NavigateUrl to "http://www.google.com".
  2. Click the Add button again to add a third RadWindow to the collection. Set the following properties:
    • Set Animation to "Resize".
    • Set Behaviors to "Resize, Minimize, Close, Maximize, Move, Reload".
    • Set OpenerElementID to "LinkButton3".
    • Set Title to "Wikipedia".
    • Set VisibleStatusBar to false.
    • Set NavigateUrl to "http://www.wikipedia.org".
  3. Click Ok to exit the collection editor.
  • 1
  • 2
  • 3
  • 4
  • 5
Configure RadSplitter
Splitter's Orientation:

Splitter's ResizeMode:

SlidingPane's resizing:

SplitBar's CollapseMode:

Locked Pane:
select


Set Pane's Background:

  • Telerik RadSplitter

    Description:

    Telerik RadSplitter is a flexible UI component for building powerful ASP.NET applications and allows users manage effectively the size and the layout of their page content. Layouts can be conveniently enhanced with sliding panes, dockable panels, resizable areas and many more splitter elements just as in Visual Studio but boosted with ASP.NET AJAX capabilities.

    Key Features:

    • Entirely based on ASP.NET AJAX, leveraging its client-side programming model
    • Resizable panels - A key feature of RadSplitter is the easy implementation of resizable panels, similar to frames. When the user drags the splitter bar, the panels on the left and/or right of the splitter are resized using one of the following 3 algorithms: 
      • AdjacentPane (default) - only the adjacent panes of the dragged split bar will be affected.
      • EndPane - only the left (top) adjacent pane and the right (bottom) most pane will be affected.
      • Proportional - the width (height) of the affected panels will be adjusted proportionally.
    • Unlimited nesting - RadSplitter allows for unlimited nesting of panels, which is appropriate for more complex interfaces. By default, the nested splitters will be resized when the pane is resized. You can, of course, change this behavior by simply setting the ResizeWithParentPane property to false.
    • Sliding panes - You can add sliding zones and panes to simulate Visual Studio .NET user interface. Those can be pinned in order to be always visible, or expandable on hover/click depending on the settings.
    • Horizontal/Vertical splitter orientation - Nest splitters to get any orientation combination. Splitter panels can be configured to split the allotted horizontally or vertically, and collapse/expand in those directions respectively.
    • Full cross-browser compatibility - for IE, Netscape, Mozilla, Opera, Firefox, and Safari on Windows, Mac OS and ux
    • XHTML 1.1 compliance

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="vb" CodeFile="DefaultVB.aspx.vb" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Splitter.Default.DefaultVB" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!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>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <style type="text/css">
            .contentPaneDecorator *
            {
                margin: 0;
                padding: 0;
            }
            .contentPaneDecorator p
            {
                margin-top: 1em;
            }
            .fontSizeSliderDecorator
            {
                width: 165px;
                padding: 25px;
                float: left;
            }
            .contentPaneDecorator
            {
                background: #698ebe;
            }
            .splitterWrapper
            {
                width: 640px;
                height: 500px;
                margin: 7px;
            }
            .pages
            {
                width: 452px;
                height: 640px;
                background: #fff;
                margin: 0 auto 10px;
                padding: 50px 20px;
                overflow: hidden;
            }
            .indexes
            {
                float: left;
                list-style: none;
                cursor: pointer;
                color: #001119;
                text-align: center;
                width: 32px;
                height: 32px;
                line-height: 32px;
                background: url(./img/page_icon.png);
                _background: url(./img/page_icon.gif); /*IE6*/
                border: none;
                font-size: 15px;
                margin: 9px;
                _margin-left: 4px; /*IE6*/
            }
            .indexes:hover
            {
                color: #0b25d4;
                background: url(./img/page_icon_hover.png);
                _background: url(./img/page_icon_hover.gif); /*IE6*/
                border: 2px solid #39B8E3;
                border: none;
            }
            .colorPickerWrapper
            {
                width: 165px;
                padding: 20px;
                float: left;
            }
            .verticalIndexes
            {
                width: 50px;
                _width: 32px; /*IE6*/
                margin: 0 auto;
            }
            .horizontalIndexes
            {
                width: 250px;
                margin: 0 auto;
            }
            .clear
            {
                clear: both;
                line-height: 1px;
                margin-top: -1px;
                list-style: none;
            }
            
            #<%= UpdatePanel1.ClientID %>
            {
                width: 654px;
                height: 514px;
                float: left;
                background-image:url(./img/border.jpg);
            }
        </style>
        </telerik:RadCodeBlock>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="VB"></qsf:Header>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadScriptBlock ID="RadSCriptBlock1" runat="server">
            <script type="text/javascript">
                function RadSplitter1_OnClientLoad(splitter, args)
                {
                    var indexes = $telerik.$(".indexes");

                    indexes.each(function (i)
                    {
                        $telerik.$(this).click(function ()
                        {
                            var contentPane = splitter.getPaneById("RadPane2");
                            var pageNo = $telerik.$(this).text();

                            var scrollValue = 750 * (pageNo - 1); //750 is the height of a 'page'
                            contentPane.setScrollPos(0, scrollValue);
                        })
                    })
                }

                function FontSizeSlider_OnClientValueChanged(slider, args)
                {
                    var targetPane = $find("<%= RadSplitter1.ClientID %>").getPaneById("RadPane2");

                    targetPane.get_element().style.fontSize = slider.get_value() + "px";
                }

                function FontColorPicker_OnClientColorChange(colorPicker, args)
                {
                    var targetPane = $find("<%= RadSplitter1.ClientID %>").getPaneById("RadPane2");

                    targetPane.get_element().style.color = colorPicker.get_selectedColor();
                }

                function BackgroundColorPicker_OnClientColorChange(colorPicker, args)
                {
                    var pages = $telerik.$(".pages");
                    pages.each(function (i)
                    {
                        pages[i].style.backgroundColor = colorPicker.get_selectedColor();
                    });
                }
            
            </script>
        </telerik:RadScriptBlock>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div class="splitterWrapper">
                    <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="640px" Height="500px"
                        Orientation="Vertical" OnClientLoad="RadSplitter1_OnClientLoad">
                        <telerik:RadPane ID="RadPane1" runat="server" Width="22px" BackColor="#698ebe">
                            <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server">
                                <telerik:RadSlidingPane ID="RadSlidingPane1" runat="server" Width="225px" Title="Decorate Pages"
                                    EnableDock="false" MinWidth="225" MinHeight="225">
                                    <div class="colorPickerWrapper">
                                        <strong>Set Content's Font-Color</strong>
                                        <br />
                                        <telerik:RadColorPicker ID="FontColorPicker" Width="165px" Preset="Standard" runat="server"
                                            Style="float: left;" OnClientColorChange="FontColorPicker_OnClientColorChange"
                                            PaletteModes="WebPalette">
                                        </telerik:RadColorPicker>
                                    </div>
                                    <div class="fontSizeSliderDecorator">
                                        <strong>Change Text Font-Size</strong>
                                        <br />
                                        <telerik:RadSlider ID="FontSizeSlider" runat="server" MinimumValue="12" MaximumValue="24"
                                            Width="165px" OnClientValueChanged="FontSizeSlider_OnClientValueChanged">
                                        </telerik:RadSlider>
                                    </div>
                                    <div class="colorPickerWrapper">
                                        <strong>Set Background-Color</strong>
                                        <br />
                                        <telerik:RadColorPicker ID="BackgroundColorPicker" Width="165px" runat="server" Style="float: left;"
                                            OnClientColorChange="BackgroundColorPicker_OnClientColorChange" Preset="Standard"
                                            PaletteModes="WebPalette" ShowEmptyColor="false">
                                        </telerik:RadColorPicker>
                                    </div>
                                </telerik:RadSlidingPane>
                            </telerik:RadSlidingZone>
                        </telerik:RadPane>
                        <telerik:RadSplitBar ID="RadSplitBar2" runat="server">
                        </telerik:RadSplitBar>
                        <telerik:RadPane ID="RadPane2" CssClass="contentPaneDecorator" runat="server">
                            <asp:Literal ID="contentHolder" runat="server"></asp:Literal>
                        </telerik:RadPane>
                        <telerik:RadSplitBar ID="RadSplitBar1" runat="server">
                        </telerik:RadSplitBar>
                        <telerik:RadPane ID="RadPane3" CssClass="contentPaneDecorator" runat="server" Width="50px"
                            MinWidth="50" MinHeight="50">
                            <ul id="indexesList" runat="server" class="verticalIndexes">
                                <li class="indexes">1</li>
                                <li class="indexes">2</li>
                                <li class="indexes">3</li>
                                <li class="indexes">4</li>
                                <li class="indexes">5</li>
                                <li class="clear"></li>
                            </ul>
                        </telerik:RadPane>
                    </telerik:RadSplitter>
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="RadioButtonListOrientation" />
                <asp:AsyncPostBackTrigger ControlID="RadioButtonListCollapseMode" />
                <asp:AsyncPostBackTrigger ControlID="RadioButtonListSlidingPaneResizing" />
                <asp:AsyncPostBackTrigger ControlID="RadComboBoxLockedPanes" />
                <asp:AsyncPostBackTrigger ControlID="PanesBackgroundColorPicker" />
            </Triggers>
        </asp:UpdatePanel>
        <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Enabled="true" Title="Configure RadSplitter"
            Expanded="true" Style="text-align: left; float: left; margin-left: 20px;" HorizontalAlign="Right"
            Width="200">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <strong>Splitter's Orientation:</strong>
    <asp:RadioButtonList ID="RadioButtonListOrientation" runat="server" AutoPostBack="true"
    OnSelectedIndexChanged="RadioButtonListOrientation_SelectedIndexChanged">

                        <asp:ListItem Text="Vertical" Value="Vertical" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Horizontal" Value="Horizontal"></asp:ListItem>
                    </asp:RadioButtonList>
                    <br />
                    <strong>Splitter's ResizeMode:</strong>
    <asp:RadioButtonList ID="RadioButtonListResizeMode" runat="server" AutoPostBack="true"
    OnSelectedIndexChanged="RadioButtonListResizeMode_SelectedIndexChanged">

                        <asp:ListItem Text="AdjacentPane" Value="AdjacentPane" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Proportional" Value="Proportional"></asp:ListItem>
                        <asp:ListItem Text="EndPane" Value="EndPane"></asp:ListItem>
                    </asp:RadioButtonList>
                    <br />
                    <strong>SlidingPane's resizing:</strong>
    <asp:RadioButtonList ID="RadioButtonListSlidingPaneResizing" runat="server" AutoPostBack="true"
    OnSelectedIndexChanged="RadioButtonListSlidingPaneResizing_SelectedIndexChanged">

                        <asp:ListItem Text="Enabled" Value="Enabled" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Disabled" Value="Disabled"></asp:ListItem>
                    </asp:RadioButtonList>
                    <br />
                    <strong>SplitBar's CollapseMode:</strong>
    <asp:RadioButtonList ID="RadioButtonListCollapseMode" runat="server" AutoPostBack="true"
    OnSelectedIndexChanged="RadioButtonListCollapseMode_SelectedIndexChanged">

                        <asp:ListItem Text="None" Value="None" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Both" Value="Both"></asp:ListItem>
                        <asp:ListItem Text="Forward" Value="Forward"></asp:ListItem>
                        <asp:ListItem Text="Backward" Value="Backward"></asp:ListItem>
                    </asp:RadioButtonList>
                    <br />
                    <strong>Locked Pane:</strong>
                    <telerik:RadComboBox ID="RadComboBoxLockedPanes" runat="server" AutoPostBack="true"
                        OnSelectedIndexChanged="RadComboBoxLockedPanes_SelectedIndexChanged">
                        <Items>
                            <telerik:RadComboBoxItem Text="None" Value="None"></telerik:RadComboBoxItem>
                            <telerik:RadComboBoxItem Text="First Pane" Value="RadPane1"></telerik:RadComboBoxItem>
                            <telerik:RadComboBoxItem Text="Second Pane" Value="RadPane2"></telerik:RadComboBoxItem>
                            <telerik:RadComboBoxItem Text="Last Pane" Value="RadPane3"></telerik:RadComboBoxItem>
                        </Items>
                    </telerik:RadComboBox>
                    <br />
                    <br />
                    <strong>Set Pane's Background:</strong>
                    <telerik:RadColorPicker ID="PanesBackgroundColorPicker" Width="165px" AutoPostBack="true"
                        runat="server" Style="float: left;" PaletteModes="WebPalette" Preset="Standard"
                        OnColorChanged="PanesBackgroundColorPicker_ColorChanged" ShowEmptyColor="false"
                        PreviewColor="false">
                    </telerik:RadColorPicker>
                </ContentTemplate>
            </asp:UpdatePanel>
        </qsf:ConfiguratorPanel>
        <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