Telerik MVC Grid: How to use DropDownList in a column?

后端 未结 3 788
太阳男子
太阳男子 2021-01-06 23:48

I have a Telerik MVC grid, in an MVC 3 application with Razor, which is being Ajax-bound. I am now trying to add a drop list column to it, so that users can use it in edit m

3条回答
  •  旧时难觅i
    2021-01-07 00:13

    Currently I'm facing same problem as you write and it is really true what Telerik guys wrote you. Partial view is pre-rendered on server (content included). This may be sufficient solution, if the list of allowed values is static, but...

    ...imagine that you want to have different list of allowed values for each grid row. In that case this concept is not feasible...

    Since there is just one combo (per column) within grid, only one solution I found is to handle onEdit grid event where you can databind combo box to allowed values using AJAX. In grid onEdit handler you can access all data fields of proper row, so you can use them for binding purposes.

    Regards, Ondrej.

提交回复
热议问题