Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datagridview blues
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Datagridview blues
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01543861
Message ID:
01543861
Views:
83
Update : to put it simply, when I'm in 0,0 my dgv goes to 1,1 i.o 0,1. When in 0,1 it goes to 1,0 which is what I want.


Why after I press _Enter_ in my dgv (datagridview) does the currentcell goto the second column on the next row when I'm in the first column (which is not what I expect) and to the first column on the next row when I press _Enter_ in the second column which is what I expect. (btw the dgv has three columns, and lValidated is set by the cellvalidating even).
    Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
        If Me.lValidated Then
            Select Case e.ColumnIndex
                Case 0
                    Me.DataGridView1.CurrentCell = Me.DataGridView1(1, e.RowIndex)
                Case 1
                    Me.DataGridView1.CurrentCell = Me.DataGridView1(0, e.RowIndex + 1)
            End Select
        End If
    End Sub
My debugging tells me that e.RowIndex = 0 when it leaves the cellendedit event, and I have not been able to detect when (if ?) the rowindex of the currentcell goes to 1 (this describes the situation when I press _enter_ in the leftmost upper cell)

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Next
Reply
Map
View

Click here to load this message in the networking platform