This question is locked. New answers and comments are not allowed.
Hi,
Is there any way that we can programmatically create MVC grid at run-time? I am trying to create a very Generic Grid that takes any Model class (IEnumerable<T> obj) as one of the parameters and then create a grid. Something like:
Is there any way that we can programmatically create MVC grid at run-time? I am trying to create a very Generic Grid that takes any Model class (IEnumerable<T> obj) as one of the parameters and then create a grid. Something like:
public
MvcHtmlString Grid<T>(... , IEnumerable<T> items, ...) where T : class
{
var
grd = _html.Telerik().Grid<T>(items).Name(name).Sortable().Pageable(paging => paging.PageSize(pageSize).Style(GridPagerStyles.NextPreviousAndNumeric).Position(GridPagerPosition.Bottom)).Scrollable();
......
create the grid here (Is it possible to build grid having both Bound and Template columns?)
......
var grid = grd.ToComponent();
return new MvcHtmlString(grid.ToHtmlString());
Thanks in advance!
}