How to count datagridview rows in csharp?
hi everyone, i need help to count the datagrid rows, in csharp.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Priya LingeRank #785 · 2.9K reputationPosted Aug 29, 2011, 3:28 AM EDT
You can get datagrid rows count by following way,
int rowcount = ((DataTable)datagrid1.DataSource).Rows.Count;
MessageBox.Show(rowcount.ToString());
Hope this will help you.
Thanks.
VulpesRank #55 · 29.2K reputationPosted Aug 29, 2011, 5:09 AM EDT
Black Diamond191 reputationPosted Aug 29, 2011, 5:21 AM EDT