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

RadSliderItem text not showing on RadSlider

1 Answer 130 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 26 Oct 2011, 07:05 PM
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

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 28 Oct 2011, 12:58 PM
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
Tags
Slider
Asked by
Daniel
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or