Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Slider > Slider (as editor) behaves strange within TabStrip

Not answered Slider (as editor) behaves strange within TabStrip

Feed from this thread
  • Posted on May 21, 2011 (permalink)

    Hello,

    I just discovered the fine TabStrip :-)

    I use it to seperate some viewmodel items over different tabs. One of them is a slider.

    But the slider behaves strange:

    - When a slider is put on the first (directly visible) tab, the viewmodel value is shown correctly 
    - When a slider is put on the second (not directly visible) tab, the viewmodel value is shown incorrectly when i click the tab
    - When a slider is put outside the tabstrip, the viewmodel value is shown correctly
    - When a slider is put on the first (not directly visible; no selectedindex set to 0) tab, the viewmodel value is shown incorrectly when i click the tab

    Incorrect behaviour is shown in the image provided. The slider is set to a value (somthing like 0.5) not equel to the value in the viewmodel (4).

    Is this a known issue?

    Regards,

    Sander

    -----


    used code:

    in the view:

    <% Html.Telerik().TabStrip()       
              .Name("TabStrip1")           
              .Items(tabstrip =>          
              {               
                  tabstrip.Add()       
                      .Text("TabA")       
                      .ImageUrl("~/Content/Common/Icons/Suites/mvc.png")        
                      .Content(() =>                
                      {%>   
                        <br/>                     
                        <br/>
                        <div class="editor-field">
                            <%: Html.EditorFor(model => model.MySlider)%>
                            <%: Html.ValidationMessageFor(model => model.MySlider)%>
                        </div
                        <br/>
                        <br/>
                      <%});        
                  tabstrip.Add()        
                      .Text("TabB")               
                      .ImageUrl("~/Content/Common/Icons/Suites/sl.png")       
                      .Content(() =>                 
                      {%>                     
                        <br/>
                        <br/>
                      <%});        
               })          
               //.SelectedIndex(0)  
               .Render();    
       %>

    (notice the SelectedIndex is put to comments) 

     

     


    The slider editor:

     

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<int?>" %>
    <%= Html.Telerik().Slider<int>()
            .Name("MySlider")
            .HtmlAttributes(new { style = "width:100" })
            .Min(0)
            .Max(10)
            .ShowButtons(true)
            .Value(Model)
    %>

     

     


    In the controller:

    return View(new AboutModel {
        MySlider = 4,
    });
     

     

     


    The viewmodel:

    public class AboutModel
    {
        [DataType("Slider")]
        public int? MySlider { get; set; }
    }
     


    Attached files

    Reply

  • Hristo Germanov Hristo Germanov admin's avatar

    Posted on May 23, 2011 (permalink)

    Hi Sander,

    Thank you for reporting this issue.

    Unfortunately, this is a bug and I am glad to inform you that it is fixed. The fix will be included in the next official release of the Telerik Components for ASP.NET MVC.

    I have attached telerik.slider.min.js file which includes the fix.

    I have updated your Telerik points.

    Greetings,
    Hristo Germanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Slider > Slider (as editor) behaves strange within TabStrip
Related resources for "Slider (as editor) behaves strange within TabStrip"

ASP.NET MVC Slider Features  |  Documentation  |  Demos  |  Telerik TV ]