计算数据网格中的行数 [英] count the number of rows in a datagrid

查看:83
本文介绍了计算数据网格中的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#

推荐答案

这不是一个适合该问题的论坛,下次,请尝试使用C#论坛或Windows Forms论坛之一.

This isn't an appropriate forum for that question, next time, please try one of the C# forums or the Windows Forms forum.

要回答您的问题,您应该能够通过查看Rows属性的Count属性来检索数据网格中的行数,即,如果您有一个名为dataGridView1的数据网格视图控件,则代码为

To answer your question, you should be able to retrieve the number of rows in the data grid by looking at the Count property of the Rows property, i.e if you have a data grid view control called dataGridView1 then the code would be

int numberOfRows = dataGridView1.Rows.Count;

int numberOfRows = dataGridView1.Rows.Count;

 


这篇关于计算数据网格中的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆