【问题标题】:Update columns with Editor template in Kendo UI MVC在 Kendo UI MVC 中使用编辑器模板更新列
【发布时间】:2014-08-29 08:58:51
【问题描述】:

我是 MVC 和 Kendo UI 的新手,使用 Kendo UI MVC 使用 Ajax 绑定创建网格,并使用编辑器模板在一个列中添加组合框。当我在组合框中选择时,它将在列 (DistDetSubName) 中显示 DataValueField,但列 DistDetID 不显示任何内容.. 我怎样才能在此列 (DistDetID) 中获取 DataTextField 组合框???

在列中带有编辑器模板的网格,如下代码:

  columns.Bound(e => e.BatNbr).Hidden(true);
 columns.Bound(e => e.RecordID).Hidden(true);
 columns.Bound(e => e.DistDetID).EditorTemplateName("test");
 columns.Bound(e => e.DistDetSubName);

Editor Templates 文件夹中 test.cshtml 中的代码:

@model string

@(Html.Kendo().ComboBox()
                      .Name("DistDetSubName")
                              .DataTextField("DistDetID")
                              .DataValueField("DistDetSubName")

      .DataSource(source =>
      {
          source.Read(read =>
          {
              read.Action("GetDist", "DM");

          })
          .ServerFiltering(false);
      })

【问题讨论】:

    标签: c# kendo-grid kendo-asp.net-mvc kendo-combobox


    【解决方案1】:

    Editor Templates 文件夹中 test.cshtml 中的代码:

    @model string
    
    @(Html.Kendo().ComboBox()
                      .Name("DistDetID")
                              .DataTextField("DistDetSubName")
                              .DataValueField("DistDetID")
    
      .DataSource(source =>
      {
          source.Read(read =>
          {
              read.Action("GetDist", "DM");
    
          })
          .ServerFiltering(false);
      })
    

    Refrence Link

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多