DataGridTableStyle.BeginEdit(DataGridColumnStyle, Int32) Method

Definition

Requests an edit operation.

C#
public bool BeginEdit(System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber);

Parameters

gridColumn
DataGridColumnStyle

The DataGridColumnStyle to edit.

rowNumber
Int32

The number of the edited row.

Returns

true, if the operation succeeds; otherwise, false.

Implements

Examples

The following code example calls the BeginEdit method on the current DataGridTableStyle in a System.Windows.Forms.DataGrid control.

C#
private void EditTable(){
   DataGridTableStyle dgt= myDataGrid.TableStyles[0];
   DataGridColumnStyle myCol = dgt.GridColumnStyles[0]; 
      
   dgt.BeginEdit(myCol,1); 
   dgt.EndEdit(myCol, 1, true);
}

Remarks

The BeginEdit method is intended to notify the System.Windows.Forms.DataGrid control when the user has begun an editing operation. When the control is in edit mode, multiple edits can be made and the constraints will be temporarily unenforced.

Call the EndEdit method to quit the edit mode.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10

See also