How to move the current cell to edit mode with selecting all text in cell while clicking on second time in WinForms GridControl?
Editing mode
In order to move the current cell to edit mode by selecting all text in a second click, the TableControlMouseDown event can be used, and the cell text can be selected using the GridTextBoxCellRenderer.
this.gridGroupingControl1.TableControlMouseDown+=gridGroupingControl1_TableControlMouseDown;
void gridGroupingControl1_TableControlMouseDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlMouseEventArgs e)
{
GridCurrentCell currentCell= e.TableControl.CurrentCell;
int row, col;
if(e.TableControl.PointToRowCol(e.Inner.Location,out row,out col))
{
if(currentCell.RowIndex.Equals(row)&& currentCell.ColIndex.Equals(col))
{
currentCell.BeginEdit();
GridTextBoxCellRenderer textRenderer= currentCell.Renderer as GridTextBoxCellRenderer;
textRenderer.TextBox.SelectAll();
}
}
}AddHandler Me.gridGroupingControl1.TableControlMouseDown, AddressOf gridGroupingControl1_TableControlMouseDown
Private Sub gridGroupingControl1_TableControlMouseDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlMouseEventArgs)
Dim currentCell As GridCurrentCell = e.TableControl.CurrentCell
Dim row, col As Integer
If e.TableControl.PointToRowCol(e.Inner.Location,row,col) Then
If currentCell.RowIndex.Equals(row) AndAlso currentCell.ColIndex.Equals(col) Then
currentCell.BeginEdit()
Dim textRenderer As GridTextBoxCellRenderer=TryCast(currentCell.Renderer, GridTextBoxCellRenderer)
textRenderer.TextBox.SelectAll()
End If
End If
End SubThe output is
as follows:

Samples: