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

Grid in Custom Template

2 Answers 81 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Zoran
Top achievements
Rank 1
Zoran asked on 20 Nov 2015, 07:48 PM

I have a custom template for editing a scheduler event. In that template I have a grid to edit an array that is part of my model:

 @(Html.Kendo().Grid<Excent.Apps.Web.Solo.Models.MeetingStudentViewModel>(Model.Students)
                .Name("StudentsGrid")
                .Columns(columns =>
                {
                    columns.Bound(m => m.MeetingStudentID).Hidden();
                    columns.Bound(m => m.FullName).Title("Student");
                    columns.Bound(m => m.Goals);
                })
                .BindTo(Model.Students)
                .DataSource(dataSource => dataSource
                     .Ajax().ServerOperation(false)
                    .Model(model => model.Id(p => p.MeetingStudentID))
                     .Model(model => model.Field(o => o.FullName))
                     .Model(model => model.Field(o => o.Goals))
               )

When I display the template the grid is empty.

2 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 24 Nov 2015, 11:34 AM
Hello Zoran,

Current behavior is expected as the editor template is executed on the server side using empty instance of the Grid model and later on the client side the edited model is bind using MVVM. The correct approach would be passing the nested Grid data using the "Edit" event of the parent widget as shown in the following example:


Regards,
Vladimir Iliev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Zoran
Top achievements
Rank 1
answered on 24 Nov 2015, 05:41 PM
Thanks.
Tags
Scheduler
Asked by
Zoran
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Zoran
Top achievements
Rank 1
Share this question
or