Articles in this section

What are the possible ways to enable edit in WinForms GridControl?

Steps to enable the edit mode


There are two possible ways to enable edit mode in Grid Control. One is activating the current cell, and the other is moving the current cell to the desired location and entering edit mode.

To set the cursor in the current cell, use the third argument GridSetCurrentCellOptions in the Activate method.

///Method1
//activate the current cell and enters to the edit mode.
this.grid.CurrentCell.Activate(e.RowIndex, e.ColIndex);

//To set the cursor in the current cell, use the third argument GridSetCurrentCellOptions in the Activate method
this.grid.CurrentCell.Activate(e.RowIndex, e.ColIndex, GridSetCurrentCellOptions.SetFocus);
 
///Method2
// by moving the current cell to the desired location and call theCurrentCell.BeginEdit method to enter the edit mode.
this.grid.CurrentCell.MoveTo(3, 5);
this.grid.CurrentCell.BeginEdit(true);
'''Method1
'activate the current cell and enters to the edit mode.
Me.grid.CurrentCell.Activate(e.RowIndex, e.ColIndex)

'To set the cursor in the current cell, use the third argument GridSetCurrentCellOptions in the Activate method
Me.grid.CurrentCell.Activate(e.RowIndex, e.ColIndex, GridSetCurrentCellOptions.SetFocus)
 
'''Method2
' by moving the current cell to the desired location and call theCurrentCell.BeginEdit method to enter the edit mode.
Me.grid.CurrentCell.MoveTo(3, 5)
Me.grid.CurrentCell.BeginEdit(True)

The screenshot shows the cell edit mode.


Edit mode is enabled in GridControl

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied