Programmatically setting the focus on a cell in a datagridview
Posted on 2007-03-26
I have a datagridview that users will enterdata into. When the form loads the first cell in the NEWROW of the datagrid should have focus and be ready for data entry (blinking cursor). I am using the following code below to do this but it is not working.
datagridview1.currentcell = datagridview1.Rows(0).Cells(0)
Using this I don't get a blinking cursor and I can't just start typing. I have also tried inserting a row with dumby data in the first cell to see if that helps and it does not. I also tried removing the datagridview1.focus line but that does not help either.