문제

I define my viewmodel called StockDataPoint and view like this,in the viewmodel I limit that the color's length is 5.In the grid,if I edit the color such as input the string 'green1' which length is larger than 5,and the grid show length no more than 5,but when I input the 'green',it should be OK,but the grid still show length no more than 5.I have update the new version such as kendo.all.min.js,jquery.min.js,but it still not work.THe project is here,and the picture is here

ViewModel:StockDataPoint

public class StockDataPoint
{
    public DateTime Date { get; set; }
    [StringLength(5, ErrorMessage = "length no more than 5")]
    public string Color { get; set; }

    public double Close { get; set; }

    public int Volume { get; set; }

    public double Open { get; set; }

    public double High { get; set; }

    public double Low { get; set; }

    public string Symbol { get; set; }
}

View:grid to show and edit data

@(Html.Kendo().Grid<ChartServerGrouping.Models.StockDataPoint>()
 .Name("DataGrid")
  .Editable(editable => editable.Mode(GridEditMode.InLine))
  .Columns(columns =>
    {
    columns.Bound(p => p.Close).Groupable(false).Title("Close").Width(120);
    columns.Bound(p => p.Color).Groupable(false).Title("Color").Width(120);
      columns.Command(command =>
        {
         command.Edit().UpdateText("Save");
         }).Width(160); })
     .Selectable(selectable => selectable.Type(GridSelectionType.Cell))
          .DataSource(dataSource => dataSource
                       .Ajax()
              .Read(read => read.Action("GetData", "Home"))
                .Update(read => read.Action("GetData", "Home"))
                  .Model(model => model.Id(p => p.Date))
                  )
                 .AutoBind(true)
     .Resizable(resize => resize.Columns(true)))  
도움이 되었습니까?

해결책

Yes,in the official web it is a bug.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top