I've tried the following, but to no avail.
if (dgvClient.SelectedRows.Count == 1)
{
selected = true;
}
Thanks.
Thanks.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
TulasiRank #2,544 · 549 reputationPosted Nov 6, 2011, 9:02 PM EST
foreach (DataGridViewRow r in dataGridView1.Rows)
Jean PaulRank #32 · 38.5K reputationPosted Nov 6, 2011, 8:34 PM EST
selected = dataGridView1.Rows[0].Selected
else for checking any of the rows are selected
selected = (dataGridView1.SelectedRows.Count > 0);