Hello,
I defined my class field “TeamCode” as string type and it only accept 4 characters. I want edit box stop accept any characters more than it's length limitation. if user try to enter 5th character in the box the cursor should not move since max length defined on that box is 4. It works well in regular Kendo TextBox. But it does not work on Kendo grid cell when do the same thing. Length limitation does not happen in the cell except when cell lose cursor. Is anyone have an idea to make it work? (Below are partial of code). Thanks in advance.
Field in class:
[StringLength(4, MinimumLength = 4, ErrorMessage = "{0} must be 4 characters.")]
[DisplayName("Team Code")]
public string TeamCode { get; set; }
Code take action in individual textbox:
@Html.Kendo().TextBoxFor(model => model.TeamCode).HtmlAttributes(new { maxlength = 4})
Code does not take action in Kendo Grid cell editor:
...
columns.Bound(m => m.TeamCode).Width(100).HtmlAttributes(new { maxlength = "4"});
...