Hi Pawel,
Thank you for your interest in Syncfusion products.
We suggest you to use the Format option inside QuerycellInfo, in order to achieve this Checkbox inside Grid.
Please refer the following code snippet to achieve this.
public ActionResult Index()
{
GridPropertiesModel model = new GridPropertiesModel
{
DataSource=context.Students.Skip(0).Take(10),
Caption="Student List",
PrimaryKeyColumns={"ID"}
};
ViewData["GridModel"] = model;
model.QueryCellInfo += new GridTableCellStyleInfoEventHandler(model_QueryCellInfo);
return View();
}
void model_QueryCellInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
if (e.TableCellIdentity.Column.MappingName == "Result")
{
if ((bool)e.Style.CellValue)
e.Style.Format = "
";
else
e.Style.Format = "
";
e.Handled = true;
}
}
}
Please refer the sample from the below link.
http://files.syncfusion.com/support/grid_mvc/Incidents/F90441/Mvc_SampleGrid.zip The Sample illustrates,
1. Result is column contains the boolean value.
2. Inside QueryCellInfo event, Result column in the grid formatted using style.Format property.
Please let me know if you have any concerns.
Regards,
M. Balaji