private void button1_Click(object sender, EventArgs e)
{
DataTable tab = new DataTable();
tab.Columns.Add("matricule", Type.GetType("System.Int32"));
tab.Columns.Add("nom", Type.GetType("System.String"));
tab.Columns.Add("part", Type.GetType("System.Int32"));
for (int i = 0; i <= dg.Rows.Count - 1; i++)
{
DataRow dr = tab.NewRow();
dr[0] = dg.Rows[i].Cells[0].Value;
dr[1] = dg.Rows[i].Cells[1].Value;
dr[2] = dg.Rows[i].Cells[2].Value;
tab.Rows.Add(dr);
}
DataRow mdr = tab.NewRow();
mdr[0] = t1.Text;
mdr[1] = t2.Text;
mdr[2] = t3.Text;
tab.Rows.Add(mdr);
dg.DataSource = tab;
}
Bonjour
j'ai un probleme de chargement Data GridView sans base ,l’exécution me donne just un seule ligne si je veut ajouter un nouveau ligne ne se realise pas avec un erreur que je ne le sais pas .
merci pou l'aide
[Translation courtesy of Google translate:]
Hello
I have a problem loading GridView Data without basis, the execution gives me just a single line if I want to add a new line will not be realized with an error that I do not know.
thank you for your help