Hi :)
I have a form which contains a datagridview.. when the form is hidding (i use hide, not close), i what to clear the datagridview, i've tried dgv.rows.clear() but it doesn't work :(
Loading
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
VulpesRank #55 · 29.2K reputationPosted Apr 23, 2013, 2:24 AM EDT
dgv.DataSource = null;
dgv.Refresh();
Anurag SarkarRank #1,049 · 1.8K reputationPosted Apr 23, 2013, 3:40 AM EDT
waqas memon141 reputationPosted Apr 24, 2013, 10:46 AM EDT
Shankar MRank #874 · 2.5K reputationPosted Apr 24, 2013, 8:36 PM EDT
Shankar MRank #874 · 2.5K reputationPosted Apr 24, 2013, 8:36 PM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 23, 2013, 2:13 AM EDT
{
dataGridView1.Rows.RemoveAt(i);
i--;
while (dataGridView1.Rows.Count == 0)
continue;
}