If itβs convenient for you when you tried to connect using NewLine , try "<br />" instead of System.NewLine .
Otherwise, what is the data type of your ProductListItem.Categories property? If it's a List<String> or some other IEnumerable , you can use a template column instead of a linked column. You use item to reference the current ProductListItem in the template:
@(Html.Telerik().Grid<ProductListItem>() .Name("Grid") .Columns(columns => { columns.Bound(o => o.Current.Name).Sortable(true).Filterable(false).Width(150); columns.Template( @<text> @String.Join("<br />", item.Categories) </text>) .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()
Another option would be to create a table in the template column and leave ProductListItem.Categories as a List , for example, this.Categories = entity.Categories.Select(o => o.Current.Name).ToList();
@(Html.Telerik().Grid<ProductListItem>() .Name("Grid") .Columns(columns => { columns.Bound(o => o.Current.Name).Sortable(true).Filterable(false).Width(150); columns.Template( @<text> <table border=0> @foreach(var category in item.Categories){ <tr><td>@category</td></tr> } </table> </text>) .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()
source share