Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27516

VS 2008 Empty fields in dgv

$
0
0
I have dgv with 4 colums (0,1,2,3) and variable number of rows.
I need to perform the calculation only if all cells in columns 1,2 and 3 are fullfilled. I tried with this code:

For r As Integer = 0 To mydgv.RowCount - 1 Step 1
For c As Integer = 1 To 3 Step 1

If mydgv.Item(c, r).Value Is Nothing Or mydgv.Item(c, r).Value Is "0" Then

MsgBox("Can not be zero or empty")
Exit Sub
Else
'do something

End If
Next c
Next r

but, calculation is performed even some cells are empty or zero. Obviously, something is wrong.
Any help will be appreciated.

Viewing all articles
Browse latest Browse all 27516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>