How to add item of checkbox in datagridview(2) to datagridview(1) for show data in checkbox(database) on datagridview(1)
My code
DataTable a = tablebill();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
bool checkBoxValue = Convert.ToBoolean(row.Cells[0].Value);
if (checkBoxValue == true)
{
a.Rows.Add(row.Cells["Products"].Value);
}
else { }
}
dataGridView1.DataSource = a;
Aucun commentaire:
Enregistrer un commentaire