jeudi 2 mars 2017

show selected checkbox in gridview

Hey guys Im fairly new to c# and i am trying to make a gridview such that only the selected checkboxes appear in the gridview. currently when i select a checkbox all the checkboxes show in grid view but i want only the selected checkbox to show. thank youu

// code to add information to rows in the grid view

int a = dataGridView2.Rows.Add();
dataGridView2.Rows[a].Cells[0].Value = IDlabel.Text;
dataGridView2.Rows[a].Cells[1].Value = springroll.Text + "," + txtspringroll.Text + " " + samosa.Text + "," + txtsamosa.Text + "" + salmonsouffles.Text + "," + txtsalmon.Text;

dataGridView2.Rows[a].Cells[2].Value = tarator.Text + "," + txttarator.Text + " " + shkembe.Text + "," + txtshkembe.Text + "" + GUVECHE.Text + "," +txtguveche.Text;
dataGridView2.Rows[a].Cells[3].Value = banista.Text + "," + txtbanista.Text + " " + garash.Text + "," + txtgarash.Text + "" +baklava.Text + "," +txtbaklava.Text;

dataGridView2.Rows[a].Cells[4].Value = water.Text + "," +txtwater.Text + " " + coke.Text + "," +txtcoke.Text + "" + apple.Text + "," + txtapple.Text;

dataGridView2.Rows[a].Cells[5].Value = txtTotal.Text;

Aucun commentaire:

Enregistrer un commentaire