how to create a checkBox header in dataGridView , I have a dataGridView and i have a CheckBox Column index=12 and i need to do a checkBox on the header , this is my code but i have a error how can i do change this code to fix it , to create the checkBox header. any body can help???? i add some code to explain what i need to do.
DataGridViewCheckBoxCell checkBoxCell = new DataGridViewCheckBoxCell();
//i have error here
dataGridViewSellers.Columns[12].HeaderCell = checkBoxCell;
foreach(Seller aSeller in sellers){
DataGridViewButtonCell buttonEditCell = new DataGridViewButtonCell();
DataGridViewButtonCell buttonDeleteCell = new DataGridViewButtonCell();
DataGridViewButtonCell buttonRestPassCell = new DataGridViewButtonCell();
dataGridViewSellers[0, i].Value = aSeller.IdNumber;
dataGridViewSellers[1, i].Value = aSeller.Name;
dataGridViewSellers[2, i].Value = aSeller.LastName;
dataGridViewSellers[3, i].Value = aSeller.PhoneNumber;
dataGridViewSellers[4, i].Value = aSeller.Address;
dataGridViewSellers[5, i].Value = aSeller.Email;
dataGridViewSellers[6, i].Value = aSeller.UserName;
dataGridViewSellers[7, i].Value = aSeller.EntryDate;
dataGridViewSellers[8, i].Value = aSeller.BusinessHours;
dataGridViewSellers[9, i] = buttonEditCell;
dataGridViewSellers[10, i] = buttonDeleteCell;
dataGridViewSellers[11, i] = buttonRestPassCell;
}