Telerik Kendo 剃须刀中内容不变的 DropDownList

Telerik Kendo DropDownList with constant content in razor

我想创建一个包含四个项目的 Telerik Kendo DropDownList:"Patient List"、"Benchmarking"、"Center Specific"、"ECMO Run"。在剃须刀 (C#) 中最简单的方法是什么?预先感谢您的帮助。

@(Html.Kendo().DropDownList()
          .Name("myDropDownList")
          .DataTextField("Text")
          .DataValueField("Value")
          .Events(e => e.Change("change"))
          .BindTo(new List<SelectListItem>() {
              new SelectListItem() {
                  Text = "Patient List",
                  Value = "1"
              },
              new SelectListItem() {
                  Text = "Benchmarking",
                  Value = "2"
              },
              new SelectListItem() {
                  Text = "Center Specific",
                  Value = "3"
              },
              new SelectListItem() {
                  Text = "ECMO Run",
                  Value = "4"
              }
          })
          .Value("1")
          .HtmlAttributes(new { style = "width: 100%" })
    )

以上只是使用Kendo UI 创建下拉列表的示例代码。 或者,您可以简单地使用简单的 HTML <select> 标记来创建下拉列表。

<select id="size" style="width: 100%;">
   <option value=1>Patient List</option>
   <option value=2>Benchmarking</option>
   <option value=3>Center Specific</option>
   <option value=4>ECMO Run</option>
</select>

另请查看以下内容link了解更多详情。

http://demos.telerik.com/aspnet-mvc/dropdownlist/index