DataGrid的行数

junqiang 2002-12-24 02:51:29
如何得到一个DataGrid的行数?
谢谢!
...全文
121 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ICDB 2002-12-24
  • 打赏
  • 举报
回复
int i = dataGrid1.VisibleRowCount;
就行了。
hfayga 2002-12-24
  • 打赏
  • 举报
回复
这里的"this.dataGrid1.Item.Count"是指写一个列名就行了
junqiang 2002-12-24
  • 打赏
  • 举报
回复
to sundy16:
在msdn中有item,但我用int i = this.dataGrid1.Item.Count时,却没有Item这个属性。为何?
TheAres 2002-12-24
  • 打赏
  • 举报
回复

int numRows = dataGridDetails.BindingContext[dataGridDetails.DataSource, dataGridDetails.DataMember].Count;
sundy26 2002-12-24
  • 打赏
  • 举报
回复
int cout = DataGrid1.Items.Count;

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧