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

ItemType and Slider's graduation mark (line) appearance

5 Answers 143 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 09 Oct 2009, 10:14 AM
Hello, Telerik support team!

Could you describe me how to solve a problem I have please.
I have an RadSlider on the web page. When its ItemType property is set to "Item", I can't force the Drag handle to be placed directly on graduation marks. It's possible only if ItemType property is set to "Tick", but I can't use slider so.
How can I force Drag handle to be displayed only on graduation line(s) instead of between of them?

Take a look at the attached png file with some description please.

Thank you a lot.
Igor Soloydenko

5 Answers, 1 is accepted

Sort by
0
Igor
Top achievements
Rank 1
answered on 12 Oct 2009, 08:33 AM
Now I am trying to solve this problem using style sheets.
For example I changed next CSS for displaying the graduation mark (line) exactly under the value item.

See result view in the attached file.

 
/* horizontal slider items */ 
.RadSlider .rslHorizontal .rslItem 
    background-image:url('Slider/ItemHorizontalBgr.gif'); 
    background-positioncenter center !important; 
  
/* style for the first item (forces to display ) */ 
.RadSlider .rslHorizontal .rslItemsWrapper .rslItemFirst 
    background-image:url('Slider/ItemHorizontalBgr.gif') !important; 
    background-positioncenter center !important; 
}  

So, all is O.K. now except of one thing. The slider is too wide now. I want to cut its sides to improve appearance. In fact it is the demand of designer.
How can I do it? Style-based solution seems to be too hard. Because there are some JavaScript responsible for Drag handle positioning. It can make me troubles.

Any help will be appreciated!
0
Accepted
Tsvetie
Telerik team
answered on 14 Oct 2009, 10:43 AM
Hi Igor,
You cannot achieve this. The main problem is that the items have the same width and in your screenshot, the width of the first and last items is less than that of the middle items. I have attached an image that outlines the items in the slider you what to get. The items of type "Item" are equal in size and this cannot be changed. You can easily position the mark for the first and last item as in the screenshot, however, you cannot change their width and as a result, the space between the first and second mark will be different (bigger) than the space between the second and third mark.

Regards,
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
Igor
Top achievements
Rank 1
answered on 14 Oct 2009, 01:56 PM
Thank you for reply, Tsvetie!
Do you mean that there is no way to decrease the width of slider at all Or I can use some tricks (or even black magic :D) to achieve this effect?
Taking in account your explanation I can try to use other images for first and last Items in slider by applying specific css styles (or classes). The width of these items (and the whole slider) will be the same. But user will see the picture I need. This method is alike to "sprites" method used in old games.

Thank you a lot.
Igor Soloydenko
0
Accepted
Tsvetie
Telerik team
answered on 16 Oct 2009, 03:42 PM
Hi Igor,
To your first question - you can easily change the width of the RadSlider control using the Width property. However, you do not want to do this, you actually want to cut off a part of the RadSlider - and yes, this is not possible.

To your second question - yes, you can use different images for the first and last slider items as these two have specific CSS classes - rslItemFirst and rslItemLast.

Greetings,
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
Igor
Top achievements
Rank 1
answered on 19 Oct 2009, 11:11 AM
Thank you for details, Tsvetie!
Yes, surely I meant the width of slider's item not slider itself.
Ok, I'll try to solve the task using tricky images.
Tags
Slider
Asked by
Igor
Top achievements
Rank 1
Answers by
Igor
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or