Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Kendo MVC Editable Grid - Numeric TextBox Not working

$
0
0
Hi,

I have Kendo MVC editable Grid  with Custom EditorTemplate for Numeric Text Box. For some reason I am getting validation error icon when i  try to update the value in numeric text box as in attached file.

I am not sure what kind of validation it is triggering as I have only required field validation. Can you pelase help me ASAP on this.


My model is as below

[Serializable]
    public class DocTypesModel
    {
        [Required(ErrorMessage = "required")]
        [UIHint("NumericTextBoxWithLimitsTemplate")]
        public int Order { get; set; }

        public int TotalCount { get; set; }

        public string DocumentTypeShortName { get; set; }      

    }

My grid is as below


 @(Html.Kendo().Grid(Model.DocTypesModel)
                      .Name("BookmarkDoctypeGrid")
                   
                     .Columns(columns =>
                      {
                            columns.Bound(c => c.Order).Sortable(false).EditorTemplateName("NumericTextBoxWithLimitsTemplate");
                          columns.Bound(c => c.DocumentTypeShortName).Title("Document Type").Sortable(false);
                        
                      })
                      .Editable(e => e.Mode(GridEditMode.InCell))
                      .Sortable()
                      .Events(e => e.DataBound("OnGridDocTypeDataBound").SaveChanges("SaveDocTypeChanges"))
                      .Resizable(resiz => resiz.Columns(false))
                      .DataSource( dataSource =>
                          dataSource.Ajax()
                           .AutoSync(true)
                           .ServerOperation(false)
                          .Update("Editing_Update", "Bookmark")
                              .Events(events => events.Error("error_handler"))
                        
                      )
                      )

I have created below custom editor for  NumericTextBoxWithLimitsTemplate under /views/shared/EditorTemplates/NumericTextBoxWithLimitsTemplate.cshtml

@model int

@(Html.Kendo()
.NumericTextBox().Step(1)
    .Name("Order").Decimals(0)
    .HtmlAttributes(new { Style = "width:70px;", required="required"})
         .Min(1).Max(short.MaxValue)
         
      

Thanks,
AArti




Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>