Hi Dmitry,
Sorry for the inconvenience caused.
One way to get the desired behavior is to store the cell value in a HashTable with rowindex as the key and retrieve it in the QueryCellInfo event to provide the cellvalues dynamically. Please try the below code snippet.
// Form_Load
this.gridListControl1.Grid.TableStyle.CheckBoxOptions = new GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", true);
this.gridListControl1.Grid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);
this.gridListControl1.Grid.CheckBoxClick += new GridCellClickEventHandler(Grid_CheckBoxClick);
//
Hashtable chkValue = new Hashtable();
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if(e.RowIndex > 0 && e.ColIndex == 3)
{
e.Style.CellType = "CheckBox";
e.Style.CellValueType = typeof(bool);
e.Style.CheckBoxOptions.CheckedValue = "true";
e.Style.CheckBoxOptions.UncheckedValue = "false";
e.Style.CheckBoxOptions = new GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", true);
e.Style.Enabled = true;
object obj = e.Style.CellValue;
if(obj != null)
{
object val = chkValue[e.RowIndex];
if(val != null)
e.Style.CellValue = val;
}
}
}
private void Grid_CheckBoxClick(object sender, GridCellClickEventArgs e)
{
if(e.RowIndex > 0 && e.ColIndex == 3)
{
object val = this.gridListControl1.Grid[e.RowIndex, e.ColIndex].CellValue;
if(val != null)
{
bool checkValue = (bool) val;
chkValue[e.RowIndex] = !checkValue;
}
}
}
Let me know if this helps for you.
Regards,
Rajagopal