[Value/Small Change/Large Change p.] issue

3 posts, 0 answers
  1. Calin
    Calin avatar
    2 posts
    Member since:
    May 2009

    Posted 05 May 2009 Link to this post


    I want to use on of the following properties : Value/Small Change/Large Change
    with a step size greater than 0 and less than 1.
    How do i accomplish that?

    Thank you!

                                    <telerik:RadSlider ID="SldTxtNrParts" runat="server"
                                        MaximumValue="20" OnClientValueChange="ChangeNumeric" Skin="Vista"
                                        ItemType="Tick" LargeChange="5" Height="30px">
                                    <telerik:RadNumericTextBox ID="TxtNrParts" Runat="server"
                                    Culture="French (France)" MinValue="0" MaxValue="20" ShowSpinButtons="True"
                                        <IncrementSettings Step="0.5" />
                                        <FocusedStyle BorderColor="#663300" backcolor="#FF9900" borderstyle="Solid" />
                                        <NumberFormat DecimalDigits="1" />
                                        <ClientEvents OnValueChanged="ChangeSlider"/>

    So, :) I want to bind a slider with a numeric control.
  2. shahab
    shahab avatar
    22 posts
    Member since:
    Oct 2012

    Posted 05 May 2009 Link to this post

    Hi Calin

    I am assuming you would like the numeric up down to be bound to the slider and vice versa . If this is what you are after then you can achive this with the help of some javascript. I have put together some code for you.
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">    
    <script type="text/javascript"
           function HandleValueChangeGreenPercent(sender, eventArgs) {  
                $get("txtGreenPercent_text").value = sender.get_value();
                $get("txtGreenPercent_Value").value = sender.get_value();
                $get("txtGreenPercent").value = sender.get_value();
           function greenpercentchanged() {  
                var greenslider = $find("<%= sldrGreenPercent.ClientID %>");  
                var greentxtbox = $find("<%= txtGreenPercent.ClientID %>");  
                var sldvalue = greentxtbox.get_value();  
                        <!-- place the textbox for the slider here--> 
                        <telerik:RadNumericTextBox ID="txtGreenPercent" runat="server" ShowSpinButtons="true" MinValue="0" MaxValue="100" 
                                                        NumberFormat-KeepNotRoundedValue="true" BorderStyle="Solid" Width="100px" 
                                                        IncrementSettings-Step="0.01" ClientEvents-OnValueChanged="greenpercentchanged"   
                                                        ClientEvents-OnBlur="greenpercentchanged" > 
    <IncrementSettings Step="0.01"></IncrementSettings> 
    <ClientEvents OnBlur="greenpercentchanged" OnValueChanged="greenpercentchanged"></ClientEvents> 
                                                       <NumberFormat AllowRounding = "false" KeepNotRoundedValue="true"  DecimalDigits="2"/>  
                        <telerik:RadSlider ID="sldrGreenPercent" runat="server" Value="0" LargeChange="5" 
                            SmallChange="1" Width="500" Height="60" MaximumValue="100" ItemType="Tick" TrackPosition="TopLeft" 
                            Skin="Telerik" /> 
    If the above scenario is what you are after then feel free to drop me a line and we can sit down together and tidy it up.
    You can see the online demo here :slider bound to numeric up down
    Hope this helps.
  3. Calin
    Calin avatar
    2 posts
    Member since:
    May 2009

    Posted 06 May 2009 Link to this post

    Thank you...
           I've accomplish the bounding issue.
           Lets presume that the numeric control has:  IncrementSettings-Step="0.07" . Whenever the numeric control is changed
           (incrementation: NumericControl.Value=0.14 / 0.21 /0.28), the SliderControl is also changed.But...
           Problem: The Value property of the SliderControl accepts only integer types. Although i've realized bidirectional binding
    in a javascript, the slider doesn't recongnize float/double values . Slider control can not use (or maybe i don't know how) values: [SliderControl.Value > 0..SliderControl.Value <1]

Back to Top