RadSlider in RadGrid EditTemplate

2 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 15 Apr 2015 Link to this post

    I try to implement a RadSlider in RadGrid EditTemplate according to this demo

     

    demos.telerik.com/aspnet-ajax/slider/examples/databinding/defaultvb.aspx

     Something like this:

     

    http://www.ulealliance.org/certification/list.aspx

     

    But the JavaScript cannot find the slider and tooltipmanager.

    Could you test with a short demo app?

    PS: I do not need the functionality with the thumbnails, onlu Slider ith step Tooltips.

     

    Thanks,

    Marc

  2. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 20 Apr 2015 Link to this post

    Hi Marc,

    Note that when you place a RadSlider control (or another ASP.NET control) in the EditTemplate of RadGrid, the slider control in each item of the grid will have a unique ClientID, while the approach shown in the demo you linked is designed for a single slider instance.

    In order to modify the demo example for multiple sliders, you could use the following method that gets the client-side objects of all sliders
    function get_allRadSliders() {
        var allRadSliders = [];
        var allRadControls = $telerik.radControls;
        // all RadControls are referenced
     
        for (var i = 0; i < allRadControls.length; i++) {
            var element = allRadControls[i];
     
            if (Telerik.Web.UI.RadSlider && Telerik.Web.UI.RadSlider.isInstanceOfType(element)) {
                allRadSliders.push(element);
            }
        }
        // only the RadSliders are gathered into an array
     
        return allRadSliders;
    }
    then call the sliderValueChanged method in pageLoad for each slider.

    Placing the RadToolTipManager in the EditTemplate should not be required, because you need only one tooltip manager to handle the tooltips on the page.

    Regards,
    Slav
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top