CheckBox selection in DataGridView..
-
Hi, i have added one checkbox to my datagridview.. i want to select the checkbox.... after selecting the check box i need to get the whole row details of that perticular checked row.. DataGridViewCheckBoxColumn ckb = new DataGridViewCheckBoxColumn(); ckb.Name = "Checkbox"; ckb.HeaderText = "Select"; dataGridView1.Columns.Insert(0, ckb); how do i select and deselect the checkbox check options... please reply me ASAP
-
Hi, i have added one checkbox to my datagridview.. i want to select the checkbox.... after selecting the check box i need to get the whole row details of that perticular checked row.. DataGridViewCheckBoxColumn ckb = new DataGridViewCheckBoxColumn(); ckb.Name = "Checkbox"; ckb.HeaderText = "Select"; dataGridView1.Columns.Insert(0, ckb); how do i select and deselect the checkbox check options... please reply me ASAP
for (int cnt = 0; cnt <= DataGridView1.Rows.Count - 1; cnt++) { DataGridView.Rows[cnt].Cells["ColSelect"].Value = true; }
1. Where ColSelect is your column name. 2. If you want to de-select just write false instead of true. 3. And if you want to know which row is checked and which is not thenfor (int index = DataGridView1.Rows.Count - 1; index >= 0; index--) { if (Convert.ToBoolean(DataGridView1.Rows[index].Cells[0].Value)) { "Selected" } else { "Not Selected" } } //End of the for :-D
Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...