Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
VB
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!
Posted

1 solution

use .Rows.Count
VB
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


reference to read
http://stackoverflow.com/questions/11612791/datagridview-rowcount-vs-rows-count[^]
 
Share this answer
 
Comments
charliedev 29-May-14 1:07am    
thanks!
DamithSL 29-May-14 1:51am    
You are Welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900