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

[Solved] Batch editing and nested classes

1 Answer 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
FinallyInSeattle
Top achievements
Rank 1
FinallyInSeattle asked on 11 Oct 2011, 09:50 PM
I have the grid below (simplified) where all 3 of the columns are within a nested class and are of type String.  The data displays correctly.  However, when I click on a cell to edit it, the "dirty" indicator displays and the cell becomes blank.  If I change the underlying model such that the column definitions are p.PartNumber, p.ChannelPartnerPartNumber & p.ProductDescription (no longer nested), it works properly.  Are nested classes not supported? 
@(Html.Telerik().Grid(Model.Order.SalesOrderLineItemResults)
        .Name("GridProducts")
        .DataKeys(keys => keys.Add(c => c.LineItemNumber))
        .ToolBar(commands =>
        {
            commands.Insert();
        })
        .DataBinding(dataBinding => dataBinding.Ajax()
            .OperationMode(GridOperationMode.Client)
            .Select("SelectProducts", "Order")
            .Update("Dummy", "Order", Model)
         )
        .Columns(columns =>
        {
            columns.Bound(p => p.SalesOrderLineItem.ProductSummary.PartNumber).Width(70).Title("MS Part #");
            columns.Bound(p => p.SalesOrderLineItem.ProductSummary.ChannelPartnerPartNumber).Width(80).Title("Your Part #");
            columns.Bound(p => p.SalesOrderLineItem.ProductSummary.ProductDescription);
        })
        .Editable(editing => editing.Enabled(Model.CanEdit).Mode(GridEditMode.InCell))
        .KeyboardNavigation(kbd => kbd.EditOnTab(true))           
        .ClientEvents(events => events.OnSubmitChanges("GridProducts_onSubmitChanges"))                   
 
.Sortable()
.Footer(false)
)

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Oct 2011, 07:19 AM
Hello Finallyinseattle,

 Nested property editing should be working. I tried in a simple project and everything went ok. You can find my test project attached.

Regards,
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
FinallyInSeattle
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or