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

How to set Maximum Value Slider Dynamically?

3 Answers 158 Views
Slider
This is a migrated thread and some comments may be shown as answers.
omer
Top achievements
Rank 1
omer asked on 27 May 2012, 05:22 PM
Hello 

Is it possible to set sliders maximum value dynamically?
i mean something like this
maximumvalue=<% bind.pricemaximum %>

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 29 May 2012, 09:42 AM
Hi Omer,

 If you have the slider in a data-bound control's ItemTemplate, you can use the standard approach of data-binding for setting the Slider MaximumValue: 
<asp:Repeater ID="theRepeater" runat="server">
    <ItemTemplate>
        <telerik:RadSlider ID="repeaterSlider" runat="server" Width="300px" MaximumValue="<%# Convert.ToDecimal(Container.DataItem) %>" ItemType="Tick" />
    </ItemTemplate>
</asp:Repeater>
theRepeater.DataSource = new[] { 10, 20, 30 };
theRepeater.DataBind();

At the same time you can use the client-side API method set_maximumValue to set the value as well.

Hope this helps.

Greetings,
Niko
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.
0
omer
Top achievements
Rank 1
answered on 29 May 2012, 02:08 PM
Thank you for reply Niko,

Actually i need set maximum value dynamically from my database. and my slider is not in itemtemplate.
I need sync RadSliders Maximum Values property with My Databases Columns Maximum Values. 
is there any way to do it?
in database is maximum value is 15056 and dynamically in sliders maximum value too. 

Kindly Regards

Ă–mer

0
Accepted
Niko
Telerik team
answered on 30 May 2012, 09:00 AM
Hello Omer,

You can always use the server-side API and once you have queried for the DB data you can use it to set the MaximumValue property of the RadSlider.
var maxValueFromDB = GetMaxValueFromDB();
theSlider.MaximumValue = maxValueFromDB;

Hope this helps.

Regards,
Niko
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
omer
Top achievements
Rank 1
Answers by
Niko
Telerik team
omer
Top achievements
Rank 1
Share this question
or