Hi Everyone....
I have a datagridview where one checkbox column is there and i have added a header checkbox.
My code for adding a header checkbox and checkbox column is
DataGridViewCheckBoxColumn c1;
CheckBox ckBox;
private void CheckboxSelect_Load(object sender, EventArgs e)
{
c1 = new DataGridViewCheckBoxColumn();
c1.Name = "selection";
c1.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
this.dgvSelectAll.Columns.Add(c1);
this.dgvSelectAll.Rows.Add();
this.dgvSelectAll.Rows.Add();
this.dgvSelectAll.Rows.Add();
this.dgvSelectAll.Rows.Add();
ckBox = new CheckBox();
Rectangle rect =this.dgvSelectAll.GetCellDisplayRectangle(0, -1, true);
ckBox.Size = new Size(18, 18);
ckBox.Location = rect.Location;
this.dgvSelectAll.Controls.Add(ckBox);
}
Is it possible If All check boxes are checked then header Checkbox will be checked and among them (Selected Check boxes)one is unchecked then header will be unchecked ??
Thank You