javascript>剑道网格>动态列筛选不工作

javascript>剑道网格>动态列筛选不工作,javascript,c#,kendo-grid,filtering,Javascript,C#,Kendo Grid,Filtering,我正在使用剑道网格显示viewModel中的信息。视图模型包含: [DisplayName("Received Date")] [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] public DateTime? ReceivedDate { get; set; } [DisplayName("Received Month")]

我正在使用剑道网格显示viewModel中的信息。视图模型包含:

[DisplayName("Received Date")]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
public DateTime? ReceivedDate { get; set; }

[DisplayName("Received Month")]
public string ReceivedMonth { get { return (this.ReceivedDate == null ? "" : this.ReceivedDate.Value.ToString("MMMM")); } }
我将剑道网格设置如下:

@(Html.Kendo().Grid<ViewModel>()
      .Name("Grid")
      .HtmlAttributes(new { style = "height:100%; width:100%;" })
      .Events(events => events.DataBound("onGridDataBound").Change("onSelectionChange").Save("onGridSave"))
      .Scrollable()
      .Columns(columns =>
      {                                                               
          columns.Bound(u => u.ReceivedDate).Format("{0:dd/MM/yyyy}").Filterable(c => c.Cell(y => y.Template("datePicker"))).Width("200px");
          columns.Bound(u => u.ReceivedMonth)
           .Title("Received Date<br/>Month")

      })
      .NoRecords("No Records to Display")
      .Editable(editable => editable.Mode(GridEditMode.InLine))
      .AutoBind(true)
      .Pageable(pageable => pageable.Refresh(true).PageSizes(new[] { 10, 20, 50, 100, 200 }).ButtonCount(5))
      .Sortable()
      .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
      .Reorderable(r => r.Columns(true))
      .Navigatable()
      .ColumnMenu()
      .EnableCustomBinding(true)
      .DataSource(dataSource => dataSource
          .Ajax()
          .ServerOperation(true)
          .PageSize(10)
          .Model(m =>
          {
              m.Id(i => i.Id);
          })
          .Read(read => read
              .Action("getData", "Data"))
          .Update(update => update
              .Action("updateViaGrid", "Data"))       
          )
      )
)
但是我无法让筛选在ReceivedMonth上工作,因为该列在下划线的数据源中不存在

我的做法正确吗?我有一个日期列,我想在它旁边有一个列,只有月份,我可以选择一个月,它将返回该月的任何数据

非常感谢您的快速成功,请尝试。服务器操作错误。当前,您正在为不存在的属性隐式地将筛选器表达式传递给剑道绑定器

这将在客户端而不是服务器上执行所有分页、排序、筛选和分组操作


如果这不适合您的用例,那么您需要在模型类中实现ReceivedMonth属性,然后您可以筛选服务器端。

您的DS Read方法是什么样子的?.ServerOperationfalse提供了我想要的,谢谢