1
votes

I'm using Kendo Grid with several columns which are used for overview row data. When users click Add/Edit buttons, the popup will be shown with some additional data which includes some checkboxes.

I have a problem when binding the checkboxes with the current MVVM model because, when adding a new row, Kendo treats the model as a variable, not an array. This causes many checkboxes to be checked when one is checked(clicked). After taking a look at Kendo MVVM, I intended to get the MVVM model of current popup in order to manipulate some data but was not successful. Therefore I would look for the help in:

  1. Getting the current MVVM model of the popup (So that I can edit the model)
  2. Any recommendation in binding many checkboxes when clicking the Add button(there is no initial data).
1

1 Answers

1
votes

you need to write a template for this then write this to the grid

.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("myTemplate"))

this is a sample template:

@model teknik.Models.Magaza_Viewmodel
    @Html.HiddenFor(model => model.ID)
    <div class="editor-label">
        @Html.LabelFor(model => model.ADI)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.ADI)
        @Html.ValidationMessageFor(model => model.ADI)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.ADRES)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.ADRES)
        @Html.ValidationMessageFor(model => model.ADRES)
    </div>