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

[Solved] Slider (as editor) behaves strange within TabStrip

1 Answer 14 Views
Slider
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sander
Top achievements
Rank 1
Sander asked on 21 May 2011, 11:18 AM
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; }
}
 


1 Answer, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 23 May 2011, 10:24 AM
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
Tags
Slider
Asked by
Sander
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or