DataGrid.EndEdit(DataGridColumnStyle, Int32, Boolean) Metoda

Definice

Požádá o ukončení operace úprav, která se provádí v ovládacím DataGrid prvku.

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

Parametry

gridColumn
DataGridColumnStyle

Chcete-li DataGridColumnStyle přestat upravovat.

rowNumber
Int32

Počet řádků, které chcete ukončit úpravy.

shouldAbort
Boolean

Nastavte na true hodnotu, jestli má být aktuální operace zastavena.

Návraty

Boolean

true pokud operace úprav přestane; falsev opačném případě .

Implementuje

Příklady

Následující příklad kódu používá BeginEdit a EndEdit metody k úpravě hodnoty v mřížce zobrazené ovládacím System.Windows.Forms.DataGrid prvku.

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

Poznámky

Metoda EndEdit vrátí false , pokud uživatel neupravuje (píše do) buňky.

Platí pro

Viz také