I have Kendo MVC Grid with Popup Editor template. I need to add Checkbox list for a model property. This is what I am doing
I declared a property in my view model like this...
public List<string> Category { get; set; }
This is how I am declaring Checkboxes in view
<ul>
@foreach (var g in (MultiSelectList)ViewData["BondPermitTypes"]) {
<li class="checkbox">
<label>
<input type="checkbox" name="Category" class="checkbox-removekvalid" id="[email protected]" value="@g.Value.ToString()" />@g.Text
</label>
</li>
}
</ul>
This code is working fine when I edit the existing records...
The problem is when I try to create new record and select any checkbox, all of the checkboxes are getting checked
Moreover, even if I hack around using jquery and force it to check only selected checkboxes then when I post back the "Category" property has only one string all the time, which is "true".
I appreciate your help!