System.invalidoperationexception: operation is not valid because it results in a reentrant call to the setcurrentcelladdresscore function

datagride with 3 column column 0 and 2 is editable when user type value in column 0 and press enter its goes to column 2 and this column is in edit mode

 Dim iColumn = DgvData.CurrentCell.ColumnIndex Dim iRow = DgvData.CurrentCell.RowIndex  If DgvData.Columns.Count = 3 Then If iColumn = DgvData.ColumnCount - 1 Then If iRow < DgvData.RowCount - 1 Then DgvData.CurrentCell = DgvData(0, iRow + 1) DgvData.BeginEdit(True)                 End If             Else                 If iRow < DgvData.RowCount - 1 Then                     SendKeys.Send("{Up}")                 End If If DgvData.Rows(iRow).Cells(0).Value.ToString = "" And DgvData.RowCount - 1 = 0 Then                     DgvData.CurrentCell = DgvData(0, 0)                     DgvData.BeginEdit(True)  Else                     DgvData.CurrentCell = DgvData(iColumn + 2, iRow)                     DgvData.BeginEdit(True) End if End if End if ``` 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.