inserting a check box into a datagridview
Hi, I tried inserting a column of checkboxes into a datagridview with code but every other information in the datagridview is shown except the column for the check boxes.Can someone help me please? Here is the code:
DataTable table = new DataTable();
table.CreateDataReader();
table.Columns.Add("CODE MOUVEMENT", typeof(string));
table.Columns.Add("NUMERO COMPTE", typeof(string));
table.Columns.Add("ORDONATEUR", typeof(string));
table.Columns.Add("MONTANT", typeof(string));
table.Columns.Add("AGENCE", typeof(string));
table.Columns.Add("DATE MOUV.", typeof(string));
table.Columns.Add("RAPPROCHER", typeof(CheckBox));
CheckBox[] chtab = new CheckBox[100];
for (int j = 0; j < v; j++)
{
CheckBox cb = new CheckBox();
chtab[j] = cb;
}
for (int i = 0; i < v; i++)
{
table.Rows.Add(ctab[i], ntab[i], otab[i], mtab[i], atab[i], dtab[i], chtab[i]);
}
dataGridView1.DataSource = table;
the other tables (ctab,atab,..) get their data from a database. They have no problem.