Posted 30 May 2023, 12:30 am EST
Hello,
can you please let me know how to implement the WPF flex grid header checkbox?
Forums Home / ComponentOne / WPF Edition
Posted by: rambabu on 30 May 2023, 12:30 am EST
Posted 30 May 2023, 12:30 am EST
Hello,
can you please let me know how to implement the WPF flex grid header checkbox?
Posted 30 May 2023, 7:50 pm EST
Hi Rambabu,
You can create checkbox in WPF flexgrid header by overriding PrepareCell method of GridCellFactory class. You can refer to the following code for the same:
public override void PrepareCell(GridCellType cellType, GridCellRange range, GridCellView cell, Thickness internalBorders)
{
base.PrepareCell(cellType, range, cell, internalBorders);
if (cellType == GridCellType.ColumnHeader && range.Column == 2)
{
var checkBox = new CheckBox();
checkBox.Content = "Check";
cell.Content = checkBox;
cell.Content.VerticalAlignment = VerticalAlignment.Center;
}
}
Please refer to the attached sample for full implementation. See
CheckboxHeaderNET6.zip
Thanks & Regards,
Aastha
Posted 2 June 2023, 7:09 am EST
Thank you, Aastha,