This is a migrated thread and some comments may be shown as answers.

Hide Slider Text

4 Answers 93 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 17 Sep 2009, 09:43 PM
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.

4 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 18 Sep 2009, 06:53 AM
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.
0
Ryan
Top achievements
Rank 1
answered on 18 Sep 2009, 12:32 PM
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!
0
Accepted
Tsvetie
Telerik team
answered on 18 Sep 2009, 02:54 PM
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.
0
Ryan
Top achievements
Rank 1
answered on 18 Sep 2009, 03:13 PM
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!
Tags
Slider
Asked by
Ryan
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or