Archana Palani

Archana Palani

  • NA
  • 26
  • 11.2k

Remove check box column from datagridview using c#

Aug 27 2014 12:11 AM

i have created datagridview dynamically with check box column,once i refresh my datagrid its removes all data except checkbox column,below code for adding checkbox column in datagrid          
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();         
chk.HeaderText = "Check Data";         
chk.Name = "chk";          
int count = dataGridView1.Rows.Count;         
 for (int i = 0; i < count; i++)          
dataGridView1.Rows[i].Cells[12].Value = false;          

and below code for clearing my datagrid,if i try to add new data in datagridview after refresh still old check box exists and it keeps adding one more checkbox column.   
any suggestion???  

Answers (5)