0

I have a form that contains a datagridview. The following code (in the form load event) is used to initialize the datagridview to allow the user to enter data. When the form displays, the cursor does not display in the cell until I actually click in the cell or start keying data. The same happens when I tab to the next cell in the grid (the cursor does not display in the cell until I click in the cell or start keying data). What am I missing?

        dgv.Rows.Add()
        dgv.ClearSelection()
        dgv.CurrentCell = dgvRows(dgv.Rows.Count - 1).Cells(2)
        dgvBscvrgGrpCd.Select()

I added the code as suggested as shown below and the blinking cursor does not appear in the column where data can be entered nor does it display when I tab to the next column.

        dgv.Rows.Add()
        dgv.ClearSelection()
        dgv.CurrentCell = dgvBscvrgGrpCd.Rows(0).Cells(2)
        dgv.BeginEdit(True)
Steve S.
  • 11
  • 3
  • `dgv.BeginEdit(true)` See [MSDN](https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.beginedit(v=vs.110).aspx?f=255&MSPPError=-2147217396&cs-save-lang=1&cs-lang=vb#code-snippet-1) – C-Pound Guru Aug 22 '17 at 19:25
  • Possible duplicate of [Datagridview: How to set a cell in editing mode?](https://stackoverflow.com/questions/1814423/datagridview-how-to-set-a-cell-in-editing-mode) – C-Pound Guru Aug 22 '17 at 19:27

0 Answers0