Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
Any CHANGE event
posted

 

Is there any web slider VALUE CHANGED event like with the TextBox that has a TEXT CHANGED event?

 

Parents
  • 12004
    posted

    Hello Wayne,

    For handling the value changed event in the WebSlider you can define this in the ClientEvents node of the WebSlider. Here's an example of the markup you can setup:

    <ig:WebSlider ID="WebSlider1" runat="server">
       <
    ClientEvents ValueChanged="WebSlider1_ValueChanged" />
    </
    ig:WebSlider>

    The definition you can define for the ValueChanged event can look like this since it's defined as WebSlider1_ValueChanged:

    function WebSlider1_ValueChanged(sender, eventArgs)
    {
       ///<summary>
       ///
       ///</summary>
       ///<param name="sender" type="Infragistics.Web.UI.WebSlider"></param>
       ///<param name="eventArgs" type="Infragistics.Web.UI.SliderValueChangedEventArgs"></param>

       //Add code to handle your event here.
      
    var label = document.getElementById('<%= Label1.ClientID %>');
       label.innerText =
    'WebSlider new value changed to ' + eventArgs.get_newValue();
    }
    // -->

    Whenever the user changes a new value in the control then this method will execute everytime in JavaScript. In this example will show the new value that was selected in the control and the eventArgs parameter object is the one that contains this value. For a reference feel free to look at documentation on our api, you can reach the url using this link for more information related to this event: http://help.infragistics.com/NetAdvantage/ASPNET/2010.2/CLR4.0/?page=Infragistics4.Web.v10.2~Infragistics.Web.UI.EditorControls.SliderClientEvents~ValueChanged.html.

    I have attached a sample for this that demonstrates the code presented above on handling value changed. This is only a client side (JavaScript operation). In the case of handling it on the server you can set under AutoPostBackFlags property and then ValueChanged as 'On'. When adding the WebSlider control, ValueChanged is automatically set to Off.

    Please note that when opening the sample there is no ig_res folder provided in the zip. Files contain images and css files that are too large to send over. You can just open it in visual studio and then on the default.aspx page you can switch over to design view. It should automatically create the necessary files so that you can see the control visually when the application is running.

    That's pretty much an overview of handling value changed.

    Let me know if you have any further questions with this matter.

    Sincerely,
    Duane Hoyt
    Developer Support Engineer, MCTS
    Infragistics
    http://ko.infragistics.com/support
     

    WebSlider_ValueChanged_CS.zip
Reply Children