I have a view model that is being used to populate a grid using razer. One of the columns is a bool datatype, and I would like the grid to display the current state of each bool in checkbox form. And I would like to be able to edit the checkbox for each row by clicking on the checkbox once.
Is this something that is possible? Currently with the use of infragistics.core.js, the value is displayed correctly with a checkbox but the disabled property is set to true and I have had no luck changing that.
Hello Jarrett,
To render the boolean column via checkbox set renderCheckbox option to true.
@(Html.Infragistics() .Grid(Model) .RenderCheckboxes(true) …
In order to directly update the value of the cell you can handle the editCellStarting.
Afterwards you can update the cell value using setCellValue method.
Afterwards you can cancel cell updating.
Here is a sample if the Boolean column's key is 'Fixed'.
$(document).delegate("#Grid1", "iggridupdatingeditcellstarting", function (evt, ui) { if (ui.columnKey !== "Fixed") { return true; } var state = ui.value; $("#Grid1").igGridUpdating("setCellValue", ui.rowID, "Fixed", !state); return false; });
You can find the sample for more details here.
I have a question here:
Is it possible to have multiple checkbox values on one column in igGrid of ignite ui/infragistics using razor MVC ?