我想在网格中显示下拉列表?

时间:2015-01-27 12:09:49

标签: html5 css3

我正在尝试在网格中显示下拉列表,但单击时不会显示下拉列表。而不是看到与数字“值”(枚举)对应的下拉列表的“文本”,我只看到应该出现下拉列表的“文本框”。当我随机点击网格时,会出现另一种奇怪的行为,下拉列表会间歇出现。

1 个答案:

答案 0 :(得分:2)

它会对你有用  @(Html.Kendo()。网格()           .NAME( “网格”)           。列(               column =>               {                   column.Bound(e => e.LanguageName)。标题(“语言名称”);                   column.Bound(e => e.CountryName)。标题(“语言名称”);                   column.Bound(e => e.CountryID).ClientTemplate(

                  @Html.DropDownListFor(model => model.CountryID, new SelectList(ViewBag.Country,"text","value"), "---  Select ---", new { @class = "form-control dropdownErp" }).ToString()).Title("Country Name"); 


           }
      )
              .Editable(editable => editable.Mode(GridEditMode.InCell))



    .DataSource(dataSource => dataSource
    .Ajax()
    .Batch(true)
    .ServerOperation(true)
  .Model(model =>
    {
        model.Id(p => p.ID);

    })
                    .Read(read => read.Action("Getdata", "Language").Type(HttpVerbs.Get))



                      )
    )