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

Slider / Reversed Direction


  • IsDirectionReversed property

    The IsDirectionReversed property of the RadSlider by default is set to false. If you set it to true the MinimumValue and MaximumValue of the slider will switch their positions.

    In the example above, we have set IsDirectionReversed=true for the thermometer slider in order to mimic the look and feel of a real thermometer.

Source Code

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

    <%@ 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" />
        <style type="text/css">
        .slideshowviewer
        {
            background:transparent url('Images/background.png') no-repeat;
            -moz-user-select: none;
            outline: none;
            width: 747px;
            height: 472px;
            cursor: default;
            padding: 5px 0 0 0;
            font-family:"Segoe UI", "Trebuchet MS", Arial, Verdana;
            clear:both;
        }
        
        .climate
        {
            width:404px;
            height:464px;
            margin:0 0 0 5px;
            float:left;
            background:transparent url('Images/climate.jpg') no-repeat;
        }
        
        .months
        {
            width:126px;
            height:450px;
            float:left;
            padding-left:20px;
            padding-top:14px;
            background:transparent url('Images/monthsBackground.jpg') no-repeat;
        }
        
        .thermometer
        {
            width:126px;
            height:412px;
            float:left;
            padding-left:60px;
         padding-top:52px;
            background:transparent url('Images/thermometer.jpg') no-repeat;
        }
        
        /* Due to a bug in IE6, when you have applied float:left and margin to an element - the margin is doubled,
           we have to apply display:inline to those elements. */
        * html .climate,
        * html .months,
        * html .thermometer
        {
            display:inline;
        }
        
        .monthsSlider .rslItemsWrapper .rslItem span
        {
            font-weight:bold;
            line-height:30px;
            padding-left:10px;
        }
        
        /* Overwrite the disabled class of the RadSlider. The slider representing a thermometer
           should be disabled, but should not look disabled. */
        .thermometerSlider div.rslDisabled
        {
            filter:none;
            -moz-opacity:1;
            opacity:1;
        }
        
        .thermometerSlider div.rslDisabled,
        .thermometerSlider div.rslDisabled a,
        .thermometerSlider div.rslDisabled li
        {
            cursor:pointer; /* all browsers but IE */
            cursor:default; /* IE */
        }
        </style>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
            <qsf:Header ID="Header1" runat="server" ShowSkinChooser="false" NavigationLanguage="c#" />
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

            <script type="text/javascript">
                function MonthChange(sender, args)
                {
                    var monthsSlider = sender;
                    var months = monthsSlider.get_items();
                    var selectedIndex = monthsSlider.get_value();
                    var selectedItemValue = months[selectedIndex].get_value();
                    
                    var thermometerSlider = $find('<%= ThermometerSlider.ClientID %>');
                    thermometerSlider.set_value(selectedItemValue);
                }
            </script>

            <div class="slideshowviewer">
                <div class="climate">
                </div>
                <div class="months">
                    <telerik:RadSlider ID="MonthsSlider" runat="server" Orientation="Vertical" Height="417px"
                        Width="100px" CssClass="monthsSlider" ItemType="Item" TrackPosition="TopLeft"
                        Value="5" OnClientValueChanged="MonthChange" Skin="Office2007">
                        <Items>
                            <telerik:RadSliderItem Text="January" Value="-2" />
                            <telerik:RadSliderItem Text="February" Value="2" />
                            <telerik:RadSliderItem Text="March" Value="5" />
                            <telerik:RadSliderItem Text="April" Value="10" />
                            <telerik:RadSliderItem Text="May" Value="14" />
                            <telerik:RadSliderItem Text="June" Value="17" />
                            <telerik:RadSliderItem Text="July" Value="20" />
                            <telerik:RadSliderItem Text="August" Value="20" />
                            <telerik:RadSliderItem Text="September" Value="18" />
                            <telerik:RadSliderItem Text="October" Value="13" />
                            <telerik:RadSliderItem Text="November" Value="4" />
                            <telerik:RadSliderItem Text="December" Value="0" />
                        </Items>
                    </telerik:RadSlider>
                </div>
                <div class="thermometer">
                    <telerik:RadSlider Skin="Vista" ID="ThermometerSlider" runat="server" ItemType="Tick"
                        MinimumValue="-10" MaximumValue="40" LargeChange="10" Orientation="Vertical"
                        Height="288px" Width="60px" ShowDragHandle="false" ShowDecreaseHandle="false"
                        ShowIncreaseHandle="false" IsDirectionReversed="true" Value="17" Enabled="false"
                        CssClass="thermometerSlider">
                    </telerik:RadSlider>
                </div>
            </div>
            <qsf:Footer runat="server" ID="Footer1" />
        </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