New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Range Slider

Use the RadSlider to filter the RadGrid.

$0
$300
SelectionStart: $0
SelectionEnd: $300
ProductCategoryQuantity per unitUnit priceUnits in stock
TofuProduce40 - 100 g pkgs.$23.2535
Genen ShouyuCondiments24 - 250 ml bottles$15.5039
Carnarvon TigersSeafood16 kg pkg.$62.5042
Teatime Chocolate BiscuitsConfections10 boxes x 12 pieces$9.2025
Sir Rodney's MarmaladeConfections30 gift boxes$81.0040
Sir Rodney's SconesConfections24 pkgs. x 4 pieces$10.003
Gustaf's KnäckebrödGrains/Cereals24 - 500 g pkgs.$21.00104
TunnbrödGrains/Cereals12 - 250 g pkgs.$9.0061
NuNuCa Nuß-Nougat-CremeConfections20 - 450 g glasses$14.0076
Gumbär GummibärchenConfections100 - 250 g bags$31.2315
Schoggi SchokoladeConfections100 - 100 g pieces$43.9049
Nord-Ost MatjesheringSeafood10 - 200 g glasses$25.8910
Gorgonzola TelinoDairy Products12 - 100 g pkgs$12.500
Mascarpone FabioliDairy Products24 - 200 g pkgs.$32.009
GeitostDairy Products500 g$2.50112
Sasquatch AleBeverages24 - 12 oz bottles$14.00111
Steeleye StoutBeverages24 - 12 oz bottles$18.0020
Inlagd SillSeafood24 - 250 g jars$19.00112
Gravad laxSeafood12 - 500 g pkgs.$26.0011
Côte de BlayeBeverages12 - 75 cl bottles$263.5017
Chartreuse verteBeverages750 cc per bottle$18.0069
Boston Crab MeatSeafood24 - 4 oz tins$18.40123
Jack's New England Clam ChowderSeafood12 - 12 oz cans$9.6585
Ipoh CoffeeBeverages16 - 500 g tins$46.0017
Gula MalaccaCondiments20 - 2 kg bags$19.4527
Rogede sildSeafood1k pkg.$9.505
SpegesildSeafood4 - 450 g glasses$12.0095
Zaanse koekenConfections10 - 4 oz boxes$9.5036
ChocoladeConfections10 pkgs.$12.7515
MaxilakuConfections24 - 50 g pkgs.$20.0010
12
Page size:
 57 items in 2 pages

The IsSelectionRangeEnabled property of the RadSlider, when set to true, configures the slider to display two drag-handles. You can se the initial values for each drag-handle using the SelectionStart and the SelectionEnd properties.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
<%@ Page Language="c#" Inherits="Telerik.Web.Examples.Slider.RangeSlider.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script src="scripts.js" type="text/javascript"></script>
</head>

<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-medium">
        <div><span class="title">Use the RadSlider to filter the RadGrid.</span></div>
        <br />
        <table>
            <tr>
                <td>$0</td>
                <td>
                    <telerik:RadSlider RenderMode="Lightweight" runat="server" ID="RadSlider1" IsSelectionRangeEnabled="true"
                        MinimumValue="0" MaximumValue="300" SmallChange="1" SelectionStart="0" SelectionEnd="300"
                        OnValueChanged="RadSlider1_ValueChanged"
                        OnClientValueChanging="demo.sliderClientValueChanging" 
                        OnClientSlideStart="demo.sliderClientSlideStart" 
                        OnClientSlideEnd="demo.sliderClientSlideEnd" 
                        AutoPostBack="true" ShowDecreaseHandle="false" ShowIncreaseHandle="false">
                    </telerik:RadSlider>
                </td>
                <td>$300</td>
            </tr>
        </table>
        SelectionStart: $<asp:Label ID="lblSelectionStart" runat="server" Text="0"></asp:Label><br />
        SelectionEnd: $<asp:Label ID="lblSelectionEnd" runat="server" Text="300"></asp:Label>
        
        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" Width="600px"
            AllowPaging="True" PageSize="30" Height="300px" GridLines="None">
            <GroupPanel ID="GroupPanel" Style="width: 100%;"></GroupPanel>
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"
                TableLayout="Fixed">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductName" HeaderText="Product" SortExpression="ProductName"
                        UniqueName="ProductName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Category" SortExpression="CategoryName"
                        UniqueName="CategoryName">
                        <HeaderStyle Width="100px"></HeaderStyle>
                        <ItemStyle Width="100px"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="QuantityPerUnit" HeaderText="Quantity per unit"
                        SortExpression="QuantityPerUnit" UniqueName="QuantityPerUnit">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="Unit price"
                        SortExpression="UnitPrice" UniqueName="UnitPrice" DataFormatString="{0:C}">
                        <HeaderStyle Width="70px"></HeaderStyle>
                        <ItemStyle Width="70px"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UnitsInStock" DataType="System.Int16" HeaderText="Units in stock"
                        SortExpression="UnitsInStock" UniqueName="UnitsInStock">
                        <HeaderStyle Width="90px"></HeaderStyle>
                        <ItemStyle Width="90px"></ItemStyle>
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <FilterMenu EnableTheming="True">
                <CollapseAnimation Duration="200" Type="OutQuint"></CollapseAnimation>
            </FilterMenu>
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
            </ClientSettings>
        </telerik:RadGrid>
        
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ProductName], [ProductID], [CategoryName], [QuantityPerUnit], [UnitPrice], [UnitsInStock] FROM [Alphabetical list of products] WHERE (UnitPrice > @MinimumPrice AND UnitPrice < @MaximumPrice)">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadSlider1" PropertyName="SelectionStart" Name="MinimumPrice"></asp:ControlParameter>
                <asp:ControlParameter ControlID="RadSlider1" PropertyName="SelectionEnd" Name="MaximumPrice"></asp:ControlParameter>
            </SelectParameters>
        </asp:SqlDataSource>
        
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadSlider1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="lblSelectionStart" UpdatePanelRenderMode="Inline"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="lblSelectionEnd" UpdatePanelRenderMode="Inline"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        
        <telerik:RadToolTip RenderMode="Lightweight" ID="RadToolTip1" runat="server" OffsetY="3" Position="TopCenter"
            ShowCallout="false" Height="20px" ShowEvent="fromcode" HideEvent="FromCode">
        </telerik:RadToolTip>
        
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function getToolTip() {
                    return $find("<%= RadToolTip1.ClientID %>");
                }
            </script>
        </telerik:RadCodeBlock>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance