archanapalani
New member
- Joined
- Aug 27, 2014
- Messages
- 2
- Programming Experience
- 1-3
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
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???
C#:
DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();
dataGridView1.Columns.Add(chk);
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; [COLOR=#111111][FONT=Segoe UI]
[/FONT][/COLOR]
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.
C#:
dataGridView1.Rows.Clear();
dataGridView1.Refresh();
any suggestion???