DataGrid.EndEdit(DataGridColumnStyle, Int32, Boolean) Método

Definición

Solicita el final de una operación de edición que tiene lugar en el control DataGrid.Requests an end to an edit operation taking place on the DataGrid control.

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

Parámetros

gridColumn
DataGridColumnStyle

Objeto DataGridColumnStyle cuya edición se va a detener.The DataGridColumnStyle to cease editing.

rowNumber
Int32

Número de la fila que se va a dejar de editar.The number of the row to cease editing.

shouldAbort
Boolean

Establezca su valor en true si debe detenerse la actual operación.Set to true if the current operation should be stopped.

Devoluciones

Boolean

true si se detiene la operación de edición; en caso contrario, false.true if the editing operation ceases; otherwise, false.

Implementaciones

Ejemplos

En el ejemplo de código siguiente se usan los métodos BeginEdit y EndEdit para editar un valor en una cuadrícula mostrada por el control System.Windows.Forms.DataGrid.The following code example uses the BeginEdit and EndEdit methods to edit a value in a grid displayed by the System.Windows.Forms.DataGrid control.

void EditValue()
{
   int rowtoedit = 1;
   CurrencyManager^ myCurrencyManager = dynamic_cast<CurrencyManager^>(this->BindingContext[ ds->Tables[ "Suppliers" ] ]);
   myCurrencyManager->Position = rowtoedit;
   DataGridColumnStyle^ dgc = dataGrid1->TableStyles[ 0 ]->GridColumnStyles[ 0 ];
   dataGrid1->BeginEdit( dgc, rowtoedit );
   
   // Insert code to edit the value.
   dataGrid1->EndEdit( dgc, rowtoedit, false );
}

private void EditValue()
{ 
   int rowtoedit = 1;
   CurrencyManager myCurrencyManager = 
   (CurrencyManager)this.BindingContext[ds.Tables["Suppliers"]];
   myCurrencyManager.Position=rowtoedit;
   DataGridColumnStyle dgc = dataGrid1.TableStyles[0].GridColumnStyles[0];
   dataGrid1.BeginEdit(dgc, rowtoedit);
   // Insert code to edit the value.
   dataGrid1.EndEdit(dgc, rowtoedit, false);
}
Private Sub EditValue()
   Dim rowtoedit As Integer = 1
   Dim myCurrencyManager As CurrencyManager = _
   CType(Me.BindingContext(ds.Tables("Suppliers")), CurrencyManager)
   myCurrencyManager.Position = rowtoedit
   Dim dgc As DataGridColumnStyle = _
   dataGrid1.TableStyles(0).GridColumnStyles(0)
   dataGrid1.BeginEdit(dgc, rowtoedit)
   ' Insert code to edit the value.
   dataGrid1.EndEdit(dgc, rowtoedit, False)
End Sub 

Comentarios

El método EndEdit devuelve false si el usuario no está editando (escribiendo en) una celda.The EndEdit method returns false if the user is not editing (typing into) a cell.

Se aplica a

Consulte también: