System.Data.DataRow.EndEdit C# (CSharp) Method

EndEdit() private method

private EndEdit ( ) : void
return void
        public void EndEdit()
        {
            if (_inChangingEvent)
            {
                throw ExceptionBuilder.EndEditInRowChanging();
            }

            if (_newRecord == -1)
            {
                return; // this is meaningless, detatched row case
            }

            if (_tempRecord != -1)
            {
                try
                {
                    // suppressing the ensure property changed because it's possible that no values have been modified
                    _table.SetNewRecord(this, _tempRecord, suppressEnsurePropertyChanged: true);
                }
                finally
                {
                    // a constraint violation may be thrown during SetNewRecord
                    ResetLastChangedColumn();
                }
            }
        }

Usage Example

Example #1
0
        private void GridConfig_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.F8)
            {
                GridColumn Colum = ((SfDataGrid)sender).CurrentColumn as GridColumn;

                if (Colum.MappingName == "bod_doc")
                {
                    int     idr = 0; string code = ""; string nombre = "";
                    dynamic xx = SiaWin.WindowBuscar("InMae_bod", "cod_bod", "nom_bod", "cod_bod", "idrow", "Maestra de Bodegas", cnEmp, true, "", idEmp: idemp);
                    xx.ShowInTaskbar = false;
                    xx.Owner         = Application.Current.MainWindow;
                    xx.Height        = 500;
                    xx.ShowDialog();
                    idr    = xx.IdRowReturn;
                    code   = xx.Codigo;
                    nombre = xx.Nombre;
                    if (idr > 0)
                    {
                        System.Data.DataRow dr = dt_doc.Rows[GridConfig.SelectedIndex];
                        dr.BeginEdit();
                        dr["bod_doc"] = code;
                        dr.EndEdit();
                    }
                }
            }
        }
All Usage Examples Of System.Data.DataRow::EndEdit