Posted 10 September 2017, 3:43 am EST
Hello,
Please refer to the attached sample which clearly implements your both requirements.
Firstly, in order to add checkbox in fixed cell, ‘SetCellCheck’ method of C1FlexGrid can be used.
[csharp]c1FlexGrid1.SetCellCheck(0, 3, C1.Win.C1FlexGrid.CheckEnum.Checked);[/csharp]
Futher click of checkbox(i.e. change in state) in a cell can be handled using ‘CellChecked’ event of C1FlexGrid.
[csharp]void c1FlexGrid1_CellChecked(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
if (e.Row == 0 && e.Col == 3)
{
ChangeState(c1FlexGrid1.GetCellCheck(e.Row, e.Col));
}
else
{
if (c1FlexGrid1.GetCellCheck(e.Row, e.Col) == C1.Win.C1FlexGrid.CheckEnum.Unchecked)
c1FlexGrid1.SetCellCheck(0, 3, C1.Win.C1FlexGrid.CheckEnum.Unchecked);
}
}
void ChangeState(C1.Win.C1FlexGrid.CheckEnum state)
{
for (int row = c1FlexGrid1.Rows.Fixed; row < c1FlexGrid1.Rows.Count; row++)
{
c1FlexGrid1.SetCellCheck(row, 3, state);
}
}[/csharp]
Please refer to the attached video showing the same.
Let me know if you face any problem.
Cheers,
Shubham Srivastava
2015/06/CustomFixedHeader.zip
2015/06/Fixed_CheckBox.gif