
I will have a form opened when i click on datagrid cell as shwon below

Now if i click on save or cancel i will close this form and i would like to select the datagridview row which i select previously


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 attend4days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Dec 3, 2010, 8:17 AM EST
Dorababu MekaRank #457 · 5.5K reputationPosted Dec 3, 2010, 7:18 PM EST
int currRow = 0;
currRow = dataGridView1.CurrentRow.Index;
dataGridView1.ClearSelection();
dataGridView1.Rows[currRow].Selected = true;