แก้ไข

แชร์ผ่าน


DataGridTableStyle.BeginEdit(DataGridColumnStyle, Int32) Method

Definition

Requests an edit operation.

public:
 virtual bool BeginEdit(System::Windows::Forms::DataGridColumnStyle ^ gridColumn, int rowNumber);
public bool BeginEdit (System.Windows.Forms.DataGridColumnStyle gridColumn, int rowNumber);
abstract member BeginEdit : System.Windows.Forms.DataGridColumnStyle * int -> bool
override this.BeginEdit : System.Windows.Forms.DataGridColumnStyle * int -> bool
Public Function BeginEdit (gridColumn As DataGridColumnStyle, rowNumber As Integer) As Boolean

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.

private:
   void EditTable()
   {
      DataGridTableStyle^ dgt = myDataGrid->TableStyles[ 0 ];
      DataGridColumnStyle^ myCol = dgt->GridColumnStyles[ 0 ];
      dgt->BeginEdit( myCol, 1 );
      dgt->EndEdit( myCol, 1, true );
   }
private void EditTable(){
   DataGridTableStyle dgt= myDataGrid.TableStyles[0];
   DataGridColumnStyle myCol = dgt.GridColumnStyles[0]; 
      
   dgt.BeginEdit(myCol,1); 
   dgt.EndEdit(myCol, 1, true);
}
Private Sub EditTable()
    Dim dgt As DataGridTableStyle = myDataGrid.TableStyles(0)
    Dim myCol As DataGridColumnStyle = dgt.GridColumnStyles(0)
    
    dgt.BeginEdit(myCol, 1)
    dgt.EndEdit(myCol, 1, True)
End Sub

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

See also