TelerikDeveloper.com

TelerikDeveloper.com

sgray128 2/20/2014 2:51:54 PM

Winforms - Move to the new row after data entry

While the user is entering data into the Winforms grid, it's often convenient to move the cursor back up to the AddNewRow line after each new rwo add. This code sample will show you how to do that                       


 

Dim cellTimer As New System.Windows.Forms.Timer()
 
Private Sub myform_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    cellTimer.Interval = 5
    AddHandler cellTimer.Tick, AddressOf cellTimer_Tick
 
 
End Sub
 
 
Private Sub RadGridView1_UserAddedRow(sender As Object, e As Telerik.WinControls.UI.GridViewRowEventArgs) Handles RadGridView1.UserAddedRow
 
    cellTimer.Start()
 
End Sub
 
Private Sub cellTimer_Tick(sender As Object, e As EventArgs)
    Me.RadGridView1.CurrentRow = RadGridView1.MasterView.TableAddNewRow
    Me.RadGridView1.CurrentColumn = Me.RadGridView1.Columns("docnumber")
 
    cellTimer.Stop()
 
End Sub