i have an datagridview .................when i click a button the gridview will appear in a panel....
while am clicking the buton can i check that datagridview is empty or not.can anybody help?
How can i check datagridview is empty or not?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Ahmed JS80 reputationPosted Nov 18, 2014, 6:37 AM EST
int k = dataGridView1.Rows.Count;
if (k<=0)
{
MessageBox.Show("Record does not exist");
}
Joginder BangerRank #360 · 7K reputationPosted Nov 18, 2014, 2:56 AM EST
datagridview.row.count();
it's return the int type value.
Michal HabalcikRank #902 · 2.3K reputationPosted Nov 18, 2014, 4:53 AM EST
DataGridView1.Rows.Count
DataGridView1.RowCount