Hide Slider Text

5 posts, 1 answers
  1. Ryan
    Ryan avatar
    61 posts
    Member since:
    Jul 2009

    Posted 17 Sep 2009 Link to this post

    I have a slider that allows a user to select a certain month/year that will filter pertinent data.  The slider's items are dynamically added, and there are about 21 in all.  Because there are many month/year items, it is impossible to read the their text, as the individual item width has gotten so small.  I have used the http://demos.telerik.com/aspnet-ajax/slider/examples/valueandrange/defaultcs.aspx example to allow the selected item's full text to be displayed in a div, but I can't figure out how to keep the smushed text along the RadSlider from displaying.

    I've tried the following:
    • Changing the slider's height to "0"
    • Setting each item's visibility to "false"
    • Setting each item's "style" attribute to "display: none;"
    • Setting the slider's LargeChange and SmallChange to high values
    • Setting each item's ForeColor to "White"

    My application release date is coming up, so I'm getting pinched for time.  Thank you.

  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 18 Sep 2009 Link to this post

    Hello Ryan,
    In order to configure your slider items not to display text, just set their text to an empty string. For example:
    RadSliderItem item = new RadSliderItem(String.Empty, "itemValue"); 

    All the best,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ryan
    Ryan avatar
    61 posts
    Member since:
    Jul 2009

    Posted 18 Sep 2009 Link to this post

    Thanks for the quick reply.  I wish this were a solution, however, I need the text to contain the month/year combination in order to present the selected text within the div.  The item's value is also occupied by the database ID associated with the month/year, so I cannot use the value to store the month/year text.

    An option that I have, though I don't want to take it, is to store the month/year text in the item's value, and when it comes time to pass the value to the database, I can simply have the database procedure parse out the text and find its database ID at that point.  This is not best practice, however, so I don't necessarily want to consider this an option.

    Any further suggestions would be greatly appreciated.  Thanks!
  5. Answer
    Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 18 Sep 2009 Link to this post

    Hi Ryan,
    In this case, you can hide the text of the items with CSS. For example:
    <head runat="server"
        <title></title
        <style type="text/css"
            .HiddenItems .rslItem span 
            { 
                visibility:hidden; 
            } 
        </style> 
    </head> 
    <body> 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <telerik:RadSlider ID="RadSlider" runat="server" ItemType="Item" Height="70" TrackPosition="BottomRight" 
            CssClass="HiddenItems"
            <Items> 
                <telerik:RadSliderItem Text="Item" Value="Item" /> 
                <telerik:RadSliderItem Text="Item" Value="Item" /> 
                <telerik:RadSliderItem Text="Item" Value="Item" /> 
                <telerik:RadSliderItem Text="Item" Value="Item" /> 
                <telerik:RadSliderItem Text="Item" Value="Item" /> 
            </Items> 
        </telerik:RadSlider> 
        </form> 
    </body> 


    All the best,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Ryan
    Ryan avatar
    61 posts
    Member since:
    Jul 2009

    Posted 18 Sep 2009 Link to this post

    That did the trick!  I tried hiding the individual items via CSS, but I guess I just needed to grab the .rslItem span items and hide them instead.  I've used "display: none;" instead of "visibility: hidden;" in the past, but I'll use "visibility: hidden;" in this case as it preserves the hidden text's space on the page (http://www.devx.com/tips/Tip/13638).

    Thank you so much for your support!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017