In my grid I have check boxes and I have a button out side the grid. When I click on the button I want to get the count of only selected rows with check boxes in the grid. How can we do that?
In my grid view dynamically create check box and another columns, I have site id column, I need to get the site id what are the check box checked.
I use this coding
int count = dataGridView1.Rows.Count;
for (int i = 0; i < count; i++)
{
int j = dataGridView1.SelectedCells[i].RowIndex;
clsSaveStatic.SiteID = int.Parse(dataGridView1.Rows[j].Cells[1].Value.ToString();
}
It returns finally Which check box is checked . But my requirement is all the checked values i need one by one.