使用Telerik MVC3電網,C#,.Net 2010;Telerik電網中的多線電池(MVC3)
我在Razor視圖網格:
@(Html.Telerik().Grid<ProductListItem>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.Current.Name).Sortable(true).Filterable(false).Width(150);
columns.Bound(o => o.Categories).Sortable(true).Filterable(false).Width(200);
//other column bindings...
})
.DataBinding(dataBinding => dataBinding.Ajax().Select(Model.GridAjaxRequestAction.ActionName, Model.GridAjaxRequestAction.ControllerName))
.Pageable(settings => settings.Total(Model.TotalRow))
.EnableCustomBinding(true)
.Sortable()
.Filterable()
我想要做的是設置網格,多的類別列。
產品可能有很多類別,因此網格中的類別單元格應該是類似的;
Category0
Category1
Category2
我想加入類別值與System.NewLine和
並指定此值ProductListItem.Categories財產。它不會改變。文本仍然是單行。
在此先感謝。
ProductListItem.Categories財產即將作爲加入的字符串; this.Categories = String.Join(「
」,entity.Categories.Select(o => o.Current.Name));我試過這個和你的建議來使用Template建議,但它仍然是一樣的:/。 – berdem
@berdem - 您可以在瀏覽器中查看HTML源代碼並粘貼它顯示的具有多個類別的表格單元格的內容嗎? – nekno