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

PanelBar / Sliding PanelBar


  • With RadPanelBar you can define side bars just like in Visual Studio.NET. To accomplish this JavaScript functions and CSS styles should be used as shown in this example. 

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ 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" %>

    <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.Web.Examples.PanelBar.ApplicationScenarios.SlidingPanelbar.DefaultCS" %>

    <%@ 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>
        <style type="text/css">
        
        .leftPanelBarContainer
        {
            float: left;
            width: 250px;
            height:250px;
            overflow: auto;
            position:relative; /* Required to workaround IE rendering bug*/
        }
        
        .rightPanelBarContainer
        {
            float: right;
            width: 250px;
            height:250px;
            overflow: auto;
            overflow: hidden; /* Required to workaround IE rendering bug*/
            position:relative;
        }
        
        </style>
        
    </head>
    <body class="BODY">
        <form id="mainForm" method="post" runat="server">
            <telerik:RadScriptManager ID="ScriptManager" runat="server" />
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="C#" XhtmlCompliant="false">
            </qsf:Header>
    <asp:ImageButton runat="server" ID="tbimage" ImageUrl="Img/Toolbox.gif" Style="float: left;
    outline: 0; width: 21px" />

            
            <div class="leftPanelBarContainer">
                <div id="slidingDiv" style="visibility: hidden">
                    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Height="250px" ExpandMode="FullExpandedItem">
                        <Items>
                            <telerik:RadPanelItem Expanded="True" Text="ASP.NET controls">
                                <Items>
                                    <telerik:RadPanelItem Text="RadComboBox" ImageUrl="img/ComboboxPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadMenu" ImageUrl="img/MenuPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadTabStrip" ImageUrl="img/TabstripPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadPanelBar" ImageUrl="img/PanelBarPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadTreeView" ImageUrl="img/TreeviewPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadToolBar" ImageUrl="img/ToolbarPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadChart" ImageUrl="img/ChartPr.gif">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="WinForms controls">
                                <Items>
                                    <telerik:RadPanelItem Text="RadComboBox" ImageUrl="img/Combobox_Win.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadDock" ImageUrl="img/Dock_Win.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadGridView" ImageUrl="img/RadGrid.bmp">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadTabStrip" ImageUrl="img/Tabstrip_Win.gif">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="Other projects">
                                <Items>
                                    <telerik:RadPanelItem Text="SiteFinity" ImageUrl="img/st.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="Reporting" ImageUrl="img/report.gif">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelBar>
                </div>
            </div>
    <asp:ImageButton runat="server" ID="tbimageRight" ImageUrl="Img/Toolbox.gif" Style="float: right;
    outline: 0;" />

            <div class="rightPanelBarContainer">
                <div id="slidingDiv2" style="visibility: hidden">
                    <telerik:RadPanelBar runat="server" ID="RadPanelBar2" Height="250px" ExpandMode="FullExpandedItem">
                        <Items>
                            <telerik:RadPanelItem Expanded="True" Text="ASP.NET controls">
                                <Items>
                                    <telerik:RadPanelItem Text="RadComboBox" ImageUrl="img/ComboboxPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadMenu" ImageUrl="img/MenuPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadTabStrip" ImageUrl="img/TabstripPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadPanelBar" ImageUrl="img/PanelBarPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadTreeView" ImageUrl="img/TreeviewPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadToolBar" ImageUrl="img/ToolbarPr.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadChart" ImageUrl="img/ChartPr.gif">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="WinForms controls">
                                <Items>
                                    <telerik:RadPanelItem Text="RadComboBox" ImageUrl="img/Combobox_Win.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadDock" ImageUrl="img/Dock_Win.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadGridView" ImageUrl="img/RadGrid.bmp">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="RadTabStrip" ImageUrl="img/Tabstrip_Win.gif">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="Other projects">
                                <Items>
                                    <telerik:RadPanelItem Text="SiteFinity" ImageUrl="img/st.gif">
                                    </telerik:RadPanelItem>
                                    <telerik:RadPanelItem Text="Reporting" ImageUrl="img/report.gif">
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelBar>
                </div>

                <script type="text/javascript">
                        var panelDomElement = $get('<%=RadPanelBar1.ClientID %>');
                        var timage = $get('<%= tbimage.ClientID %>');
                        
                        if (panelDomElement)
                        {
                         SetUpAnimation(timage.id, Telerik.Web.UI.jSlideDirection.Right, panelDomElement);
                        }

                        var panelDomElementRight = $get('<%=RadPanelBar2.ClientID %>');
                        var timageRight = $get('<%= tbimageRight.ClientID %>');
                        
                        if (panelDomElementRight)
                        {
                         SetUpAnimation(timageRight.id, Telerik.Web.UI.jSlideDirection.Left, panelDomElementRight);
                        }
                        function SetUpAnimation(image, direction,element)
                        {
                            element.style.position = "relative";
                            var slider = document.getElementById(image);
                         
                            var expanded = false;
                            
                            var expandAnimation =new Telerik.Web.UI.AnimationSettings({});
                            var collapseAnimation = new Telerik.Web.UI.AnimationSettings({});
                            
                         var slide = new Telerik.Web.UI.jSlide(element, expandAnimation, collapseAnimation, false);
                         
                            slide.initialize();
                            
                            slide.set_direction(direction);
                            
                            slider.onclick = function ()
                            {
                                element.parentNode.style.visibility = "visible";
                                element.parentNode.style.display = "block";
                                if (!expanded)
                                {
                                    slide.expand();
                                }
                                else
                                {
                                    slide.collapse();
                                }
                                expanded = !expanded;
                                return false;
                            }
                        }
                </script>

            </div>
            <qsf:Footer ID="Footer1" runat="server"></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