I'm using ajax() binding on my grid datasource. (MVC Server Wrappers)
I have a PopUp Editor comming up showing my data i want to edit.
I want to display multiple checkboxes for one value. (have a look at the attached screenshot)
But when i select one checkbox, all other checkboxes get selected as well.
Do you have any clue?
8 Answers, 1 is accepted
I have the same problem,
While editing the existing records it is working just fine. But while creating all checkboxes gets selected when I select any checkbox.
Daniel, have you found a solution yet?
The issue was resolved in a private support ticket.
The described problem will occur if the value in the dataSource model is not an array. In this case the checkboxes will not be bound as list. Their checked state will be bound to the model value. Here is an example that demonstrates the difference.
As for removing the data-bind attribute - you can add a data-skip attribute to the checkboxes in order to prevent the attribute to be added automatically based on the name:
I hope this information will help.
I am generating checkboxes like this...
Generating like above works perfectly ok when I am editing existing records. The Category of the model will have the list of values that will be selected from the list of checkboxes. But while creating new records all of the checkboxes are getting checked.
If I use data-skip="true", even editing does not work.
Would you be able to create a working project and send it for me.
We do not have example that matches your requirements.
Is it possible for you to isolate the scenario in a separate project with mock data? In this way I will be able to examine what is going wrong and assist you further.
I have attached an isolated project.
Since it only allows maximum of 2 MB file size. You will need to install asp.net mvc nuget package and others as needed.
Please go to Home/KendoGrid to view the Grid. I strongly hope that you will send me back a working project asap.
Please also make sure that the CreateUser and UpdateUser are sending right Roles list (see in the project)
Thank you very much!
I was able to run and examine the provided project.
The issue occurs because the newly created item does not have 'Roles' property. In order to resolve the issue you should set default value for the 'Roles' field. The default value should be array.
Please check the sample from this help article as it explains how to set default value of a model field.
It WORRRKS !!!
Thank you very much Alexander. You are great.