Thanks, Rajagopal.
It works apart from one of the requirements that I forgot to mention in my first post. It is allowed to have all checkboxes in the column to be unchecked, but only one of them can be checked.
Regards,
Albert
>Hi Albert,
Please try the code below in the CurrentCellChanged event handler of the grid, to have mutually exclusive checkboxes in a checkbox column.
private void gridDataBoundGrid1_CurrentCellChanged(object sender, EventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(cc.Renderer.StyleInfo.CellType == "CheckBox")
{
bool check = (bool)cc.Renderer.StyleInfo.CellValue;
for(int i = 1; i <= this.gridDataBoundGrid1.Model.RowCount; i++)
{
if(check)
this.gridDataBoundGrid1.Model[i, cc.ColIndex].CellValue = false;
}
this.gridDataBoundGrid1.Model[cc.RowIndex, cc.ColIndex].CellValue = true;
}
}
Let me know if this helps.
Regards,
Rajagopal