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

[Solved] Problem with two or more IntegerTextBox on grid (edit mode)

2 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 10 Jan 2011, 04:49 AM
Hi. I have problem with Telerik Grid with 2 or more IntegerTextBox Templates when I use the edit mode (I use popup edit mode).
When the popup is showed, only the last IntegerTextBox show the correct value. The others IntegerTextBox show the "0" value.

Is similar to this error

My View Model is:

public class ConditionedAlternativeViewModel
    {
        [ScaffoldColumn(false)]
        public int Id { get; set; }
 
        [Required(ErrorMessage = "Campo obligatorio")]
        [DisplayName("Descripción izquierda")]
        [DataType(DataType.Text)]
        public string DescripcionIzquierda
        {
            get;
            set;
        }
 
        [Required(ErrorMessage = "Campo obligatorio")]
        [DisplayName("Puntaje izquierda")]
        [DataType("Double")]
        [Range(0, int.MaxValue, ErrorMessage = "Ingrese un valor mayor o igual 0")]
        public double PuntajeIzquierda
        {
            get;
            set;
        }
 
        [Required(ErrorMessage = "Campo obligatorio")]
        [DisplayName("Descripción derecha")]
        [DataType(DataType.Text)]
        public string DescripcionDerecha
        {
            get;
            set;
        }
 
        [Required(ErrorMessage = "Campo obligatorio")]
        [DisplayName("Puntaje derecha")]
        [DataType("Double")]
        [Range(0, int.MaxValue, ErrorMessage = "Ingrese un valor mayor o igual 0")]
        public double PuntajeDerecha
        {
            get;
            set;
        }
    }

My Telerik grid is (I use T4MVC):

<%= Html.Telerik().Grid<PHDWeb.ViewModels.ConditionedAlternativeViewModel>()
        .Name("ConditionedAlternativeGrid")
        .Localizable("es-ES")
        .DataKeys(keys => keys.Add(p => p.Id))
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }))
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
                .Select(MVC.PortalSercotec.Alternative._SelectConditionedAlternative().GetRouteValueDictionary())
                .Insert(MVC.PortalSercotec.Alternative._InsertConditionedAlternative().AddRouteValue("QuestionId", Url.RequestContext.RouteData.Values["id"]).GetRouteValueDictionary())
                .Update(MVC.PortalSercotec.Alternative._UpdateConditionedAlternative().AddRouteValue("QuestionId", Url.RequestContext.RouteData.Values["id"]).GetRouteValueDictionary())
                .Delete(MVC.PortalSercotec.Alternative._DeleteConditionedAlternative().AddRouteValue("QuestionId", Url.RequestContext.RouteData.Values["id"]).GetRouteValueDictionary());
        })
        .Columns(columns =>
        {
            columns.Bound(p => p.DescripcionIzquierda).Title("Descripción izquierda");
            columns.Bound(p => p.PuntajeIzquierda).Title("Puntaje izquierda");
            columns.Bound(p => p.DescripcionDerecha).Title("Descripción derecha");
            columns.Bound(p => p.PuntajeDerecha).Title("Puntaje derecha");
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.ImageAndText);
                commands.Delete().ButtonType(GridButtonType.ImageAndText);
            }).Width(250).Title("Acciones");
        })
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        .Pageable()

And my editor for "Double" are:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<double>" %>
 
<%= Html.Telerik().IntegerTextBox()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .ButtonTitleUp("Incrementar valor")
        .ButtonTitleDown("Disminuir valor")
        .InputHtmlAttributes(new { style = "width:100%" })
        .MinValue(0)
        .MaxValue(int.MaxValue)
        .Value(Convert.ToInt32(Model))
        .InputHtmlAttributes(new { value = Convert.ToInt32(Model) })
%>

In the image 1, i show an example with 2 "double" template. In the image 2, i show an example with 3 "double" template.

Any solution? My telerik version is 2010.3.1129.235

Thanks.

2 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 10 Jan 2011, 03:23 PM
Can you confirm if is a bug?

Thanks.
0
Daniel
Top achievements
Rank 1
answered on 12 Jan 2011, 03:42 AM
Hi Atanas, and sorry by me insistence.
I try to do a solution with jquery, but don`t work. Can you help me plis? I really need some help ^^'

Can be a problem with the name?

Thanks.
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Share this question
or