RadSliderItem text not showing on RadSlider

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jun 2010

    Posted 26 Oct 2011 Link to this post

    Hi

    I use the RadSlider. I programicly from code behind put the items in the RadSlider. The thing is that i put too many items and the text is not shown, it's like "...", you can see it in the attachment. I put the tool tip but i also want to show the text.

    In the code i tried this
    for (double minute = 0; minute <= minutes; minute = minute + 15)
                {
                    RadSliderItem radSliderItem;
                   if (((int)minute) % 60 == 0)
                   {
                       radSliderItem = new RadSliderItem(workHoursStartDate.ToString("HH:mm"), minute.ToString());
                        radSliderItem.ToolTip = workHoursStartDate.ToString("HH:mm");
                    }
                    else
                    {
                        radSliderItem = new RadSliderItem("", minute.ToString());
                       radSliderItem.ToolTip = workHoursStartDate.ToString("HH:mm");
                    }
                    sliderTimeOffSlider.Items.Add(radSliderItem);
                    workHoursStartDate = workHoursStartDate.AddMinutes(15);
                }

    i thought that if i don't put text on all items, that the text will be shown on those that have.
    Before that the code was like this
    for (double minute = 0; minute <= minutes; minute = minute + 15)
                {
                    RadSliderItem radSliderItem;
                    radSliderItem = new RadSliderItem(workHoursStartDate.ToString("HH:mm"), minute.ToString());
                    radSliderItem.ToolTip = workHoursStartDate.ToString("HH:mm");               
                    sliderTimeOffSlider.Items.Add(radSliderItem);
                    workHoursStartDate = workHoursStartDate.AddMinutes(15);
                }

    I have pictures in the attachment from both cases.

    So  do you have solution so i can show the time on the radSlider and not just on the tool tip

    Regards,
    Goran
  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 28 Oct 2011 Link to this post

    Hi Goran,

    Please note that the text of the items isn't displayed because there isn't enough space. My suggestion is to set enough width to the RadSlider so that the text of the items can fit or to use the RadToolTip control in order to show the value of the item's ToolTip propery while dragging the handlers. The latter approach is implemented in the attached sample page. You can use it as a reference to incorporate the functionality, should you choose this solution.

    Kind regards,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top