View Single Post
  #1 (permalink)  
Old June 26th, 2009, 12:26 PM
ebassador ebassador is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Location: Simi Valley, CA USA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagridview Set Focus Next Control

I can't figure out where to put the code to advance to the next datagridview control when a specific condition occurs. Here's the code to set the focus.
Code:
Friend Sub Advance2Next(ByVal dgv As DataGridView)
Dim gc AsInteger = dgv.CurrentCell.ColumnIndex
Dim gr AsInteger = dgv.CurrentCell.RowIndex
dgv.CurrentCell = dgv.Item(gc + 1, gr)
EndSub
This code keeps giving me this error: Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.

I'm calling this Sub from within the CellEnter event.

Last edited by ebassador : June 26th, 2009 at 01:41 PM. Reason: [Code] and [/code] tags
Reply With Quote