dimanche 20 décembre 2015

wrong index of checkbox column in datagrid

I have this code to add a checkbox column in the third position, but the index of this column(bloqueador) is 0 and not 3. What is wrong?

public void bloqselect()
{
 DataGridViewCheckBoxColumn chkSelect = new DataGridViewCheckBoxColumn();
 chkSelect.Selected = false;
 chkSelect.HeaderText = "Bloqueador";
 chkSelect.Name = "chkSelect";
 grid_lic.Columns.Insert(3, chkSelect);

 if (chkSelect.Selected == true)

    bloqueador = 1;
  else
   bloqueador = 0;
}

checkbox column index




Aucun commentaire:

Enregistrer un commentaire