I'm setting up an MVC grid with a true/false column to represent if the row is a selected row (to store in the database). The problem occurs when i click the true/false cell, a checkbox shows up as expected, but when i attempt to click the checkbox, instead of checking the box, the cell goes back to display mode. If I click the cell to put it in editing mode and use the space bar, it will check the checkbox just fine, but I need the ability to use a mouse click to check the box.
Here's the grid:
Here's the model.
I've looked through the forums for similar issue, but I cannot see what I'm doing wrong. Please help if you can.
Here's the grid:
Html.Kendo().Grid<SelectedProjects>()
.Name("StaticViewGrid")
.HtmlAttributes(new { @style = "display:inline-block;" })
.Columns(columns =>
{
columns.Bound(o => o.Selected);
columns.Bound(o => o.SystemID);
columns.Bound(o => o.ProjectName);
columns.Bound(o => o.Environment);
columns.Bound(o => o.SitEntryDate).Format("{0:d}");
columns.Bound(o => o.SitExitDate).Format("{0:d}");
columns.Bound(o => o.ProductionInstallDate).Format("{0:d}");
})
.ToolBar(toolbar => toolbar.Save())
.Editable(editing => editing.Mode(Kendo.Mvc.UI.GridEditMode.InCell))
.Filterable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(model =>
{
model.Id(o => o.EngagementID);
model.Field(o => o.Selected).Editable(true);
model.Field(o => o.SystemID).Editable(false);
model.Field(o => o.ProjectName).Editable(false);
model.Field(o => o.Environment).Editable(false);
model.Field(o => o.SitEntryDate).Editable(false);
model.Field(o => o.SitExitDate).Editable(false);
model.Field(o => o.ProductionInstallDate).Editable(false);
})
.Read(read => read.Action("SelectedEngagementItemData", "Amethyst"))
.Update(update => update.Action("SelectedEngagementItems_Update", "Amethyst"))
)
Here's the model.
public partial class SelectedProjects
{
public Guid EngagementViewID { get; set; }
public string EngagementViewName { get; set; }
public bool Selected { get; set; }
public int EngagementID { get; set; }
public Nullable<int> SystemID { get; set; }
public string ProjectName { get; set; }
public string Environment { get; set; }
public Nullable<DateTime> SitEntryDate { get; set; }
public Nullable<DateTime> SitExitDate { get; set; }
public Nullable<DateTime> ProductionInstallDate { get; set; }
}
I've looked through the forums for similar issue, but I cannot see what I'm doing wrong. Please help if you can.