Please note that when the ItemType
property of the RadSlider is set to Item,
the items in the Items
collection define the possible values for the slider.
property of the slider in this case represents the index in the Items
collection of the currently selected slider item. This is why when you specify a value 1, the item with this index, which is the second item, is selected.
In order to set as selected the item of the slider control, corresponding to passed value, you should specify the correct index in the Items
collection, as demonstrated below:
selectedItemValue = 3;
RadSlider1.SelectedValue = RadSlider1.Items[selectedItemValue - 1].Value;
In the provided example the value of the selected item is 3 and the index, passed to the Items collection, is 2 in order to reference the third item.
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