将Kendo Grid中的列从int转换为string

时间:2017-07-10 01:43:46

标签: kendo-ui kendo-grid

这可能是一个简单的答案,但即使在搜索完文档后我还没有想出来。我在Kendo Grid中有一个列,我想将整数转换为字符串以进行过滤。基本上在我的ID列上,如果用户键入3,它将过滤3,13,23 33等的记录。现在它在我输入3并点击回车后在过滤器中做了什么,它将它转换为33.00以下是网格

@(Html.Kendo().Grid<RequestViewModel>
      ()
      .Name("MyGrid")
      .Columns(columns =>
      {
          columns.Bound(c => c.ID).Hidden(true);
          columns.Bound(c => c.ID).Title("Ticket No.")
              .ClientTemplate(@Html.ActionLink("#=ID#", "View", new { ID = "#=ID#" }).ToHtmlString())
              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
         //  Something here like   .ToString()

          columns.Bound(c => c.CreatedDate).Title("Submitted On").ClientTemplate("#= kendo.toString(kendo.parseDate(CreatedDate), 'MM/dd/yyyy HH.mm.ss') #").Filterable(ftb => ftb.Cell(cell => cell.Template("DateTimeFilter")));
          columns.Bound(c => c.DepartmentName).Title("Department Requested To").Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
          columns.Bound(c => c.Technician).Title("Technician Assigned").Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));
      })
      .Sortable()
      .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
      .Pageable(pageable => pageable
          .Refresh(true)
          .PageSizes(true)
          .ButtonCount(5))
      .DataSource(dataSource => dataSource
          .Ajax()
          .ServerOperation(true)
          .PageSize(10)
          .Model(model => model.Id(x => x.ID))
          .Read(read => read.Action("Action", "DataSource"))
       )

0 个答案:

没有答案