This is a migrated thread and some comments may be shown as answers.

MVC Grid with unknown columns and incell editing

1 Answer 219 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 2
Peter asked on 20 Nov 2013, 06:39 PM
I'm currently working on converting a Silverlight project into an MVC project.  
I'm working on a grid where the number of columns and the names of the columns are not known at design-time.  
Each column in the grid, other than the first one, should contain a checkbox.  I'd like each checkbox to be incell editable with a batch save option.
A screenshot of the current Silverlight version is attached.

I'm having a lot of difficulty getting this to work.  I tried a few different ways by using examples found in this forum.  
http://www.kendoui.com/forums/kendo-ui-complete-for-asp-net-mvc/grid/kendo-mvc-grid---data-binding-to-dynamic-object-model.aspx

So, my question is, is there a way to make a grid truly dynamic that also works with batch/incell editing?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Nov 2013, 12:55 PM
Hello Peter,

It is possible to use InCell editing with a dynamic model but you will need to specify the editor template for each column with the column EditorTemplateName method e.g.
.Columns(columns =>
{
    foreach (var gridColumn in gridColumns)
    {
        columns.Bound(gridColumn.FieldName).EditorTemplateName(gridColumn.EditorTemplateName);
    }
})
because they cannot be determined from the dynamic model.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Peter
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or