We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to move the current cell to edit mode with selecting all text in cell while clicking on second time in WinForms GridControl?

Platform: WinForms |
Control: GridControl

Editing mode

In order to move the current cell to edit mode with selecting all text in second click, TableControlMouseDown event can be used and the cell text can be selected using GridTextBoxCellRenderer.


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))
         GridTextBoxCellRenderer textRenderer= currentCell.Renderer as GridTextBoxCellRenderer;


AddHandler 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
         Dim textRenderer As GridTextBoxCellRenderer=TryCast(currentCell.Renderer, GridTextBoxCellRenderer)
    End If
  End If
End Sub



Current cell to edit mode in second click


C#: SelectAllText_in_SecondClick_CS

VB: SelectAllText_in_SecondClick_VB


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile