如果DGV没有行问题 [英] If DGV has no rows question
本文介绍了如果DGV没有行问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Microsoft Visual Studio 2005
我有4个DataGridViews和一个标签。
我如何制作标签文本这个: - - 当所有数据网格都没有行?
i尝试
I am using Microsoft Visual Studio 2005
I have 4 DataGridViews and a label.
How do i make a label text like this: "- -" when all of the datagrids have no rows?
i tried
If (DGV1.RowCount = 0) And (DGV2.RowCount = 0) And (DGV3.RowCount = 0) And (DGV4.RowCount = 0) Then
label1.text = "- -"
End If
但它不起作用
提前感谢!
but it doesnt work
thanks in advance!
推荐答案
使用.Rows.Count
use.Rows.Count
If (DGV1.Rows.Count= 0) And (DGV2.Rows.Count= 0) And (DGV3.Rows.Count= 0) And (DGV4.Rows.Count= 0) Then
label1.text = "- -"
End If
参考阅读
http://stackoverflow.com/questions/11612791/datagridview-rowcount-vs-rows-count [ ^ ]
这篇关于如果DGV没有行问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文