Private Sub findSelectedRowID() Dim SaveID As Integer = 0 If Not IsNothing(grdTimeCard.ActiveRow) Then Dim rowID As Integer = 0 rowID = grdTimeCard.ActiveRow.Index + 1 SaveID = grdTimeCard.Rows(rowID).Cells("RecID").Value End If RefreshGrid() If SaveID > 0 AndAlso grdTimeCard.Rows.Count > 0 Then Dim Count As Integer = 0 Dim Found As Boolean = False While Not Found AndAlso Count < grdTimeCard.Rows.Count If grdTimeCard.Rows(Count).Cells("RecID").Text = SaveID Then Found = True grdTimeCard.Rows(Count).Activate() grdTimeCard.ActiveCell = grdTimeCard.Rows(Count).Cells("WorkDate") grdTimeCard.PerformAction(UltraGridAction.EnterEditMode, False, False) Else Count = Count + 1 End If End While End If End Sub
Here is the code that I've came up with. The breakdown is as follow:
1) After updating a row in the grid, it goes and finds the RecID of the row after going to the next row index.
2) It then refills the table adapter and does all the grid "stuff" (not relevant to this portion).
3) It sets the row in which you are continuing from.
4) It sets the ActiveCell and then enter into edit mode (which enters edit mode on the active cell).
Only problem is that there is no way to enter edit mode except with the .PerformAction(UltraGridAction.EnterEditMode) function (that I know of through searching). For some reason, it doesn't enter into edit mode at the first visible cell (which I set manually). Does anyone know how to get the grid into edit mode as I have specified. If there is another way to get the UltraGrid to enter edit mode, I would definitely be open to trying a different way into forcing it into edit mode. Thanks in advance!
