Question : DataGridView /  BeginEdit(True)  ?

Using vb.net/winform and DataGridView. On the CellEnter event I have BeginEdit(True). This is fine. Only that the cursor is placed at the end of whatever text exists. I would like to have the cursor either at the beginning of the text or for the entire text to be selected and whatever is typed erases it. How can I do this?

Answer : DataGridView /  BeginEdit(True)  ?

How about this:

 Dim editControl As DataGridViewTextBoxEditingControl = DirectCast(_your_grid.EditingControl, DataGridViewTextBoxEditingControl)

        If Not editControl Is Nothing Then
            editControl.SelectionStart = 0
            editControl.SelectionLength = editControl.Text.Length
        End If
Random Solutions  
 
programming4us programming4us