DataGrid.EndEdit(DataGridColumnStyle, Int32, Boolean) Metoda

Definice

Požádá o ukončení operace úprav, která probíhá 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

Ukončit DataGridColumnStyle úpravy.

rowNumber
Int32

Počet řádků, které chcete přestat upravovat.

shouldAbort
Boolean

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

Návraty

truepokud operace úprav přestane; v opačném případě . false

Implementuje

Příklady

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

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 se vrátí false , pokud uživatel neupravuje (zadává do) buňky.

Platí pro

Viz také