0

Dears

Private Sub DataGridView1_CellLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellLeave
If e.ColumnIndex = 0 And e.RowIndex = 0  Then
            MsgBox("this is first coulmn")
        End IfEnd Sub

IF cursor leaves column 0 and row 0 then it displays msgbox but
I want to check where column 0 and row 0 has value or empty

In case of empty cell it must display msg as
msgbox("this is empty cell")

Please help

Attachments cell.JPG 74.59 KB
3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by sknake
0

What is the best datagridview event to use these codes

I want to check column 0 is empty or has some value

If e.ColumnIndex = 0 Then
            If DataGridView1.CurrentCell.Value = "" Then
                MsgBox("Empty Value")
            Else
                MsgBox("Not empty column")
            End If
        End If

Please help

0

It depends when you're trying to check the value. Please describe what you are doing in a little more detail.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.