データグリッドのセルを離れるときに BindingSource.AddingNew が呼び出されることはありません。
DataGrid はデータソースとして、再び「Customer」の「List」を持つ BindingSource を持っています。
BindingSource が新しい Customer オブジェクトを作成し、基になる ICustomerList に追加するには何が必要ですか?
もちろん、インターフェースにはコンストラクターがありません...
しかし、私の顧客オブジェクトにはデフォルトのコンストラクターがあります!
それは私が得る例外です:
System.MissingMethodException: The constcructor for the type "SAT.EnCoDe.Administration.ICustomer" was not found.
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr、バインダー バインダー、Object[] args、CultureInfo culture、Object[] activationAttributes) System.SecurityUtils.SecureCreateInstance(Type type、Object[] args) System.ComponentModel.BindingList1.AddNewCore()
bei System.ComponentModel.BindingList1.System.ComponentModel.IBindingList.AddNew() は System.Windows.Forms.BindingSource.AddNew() であり、System.Windows.Forms.CurrencyManager.AddNew() であり、DevExpress.Data.CurrencyDataController.OnCurrencyManagerAddNew() であり、DevExpress.Data です。 CurrencyDataController.AddNewRow() DevExpress.XtraGrid.Views.Grid.GridView.OnActiveEditor_ValueModified(Object sender, EventArgs e) DevExpress.XtraEditors.Repository.RepositoryItem.RaiseModified(EventArgs e) DevExpress.XtraEditors.BaseEdit.OnEditValueChanging(ChangingEventArgs e) . BaseWndProc(メッセージ&m) DevExpress.XtraEditors.Mask.MaskBox.WndProc(Message& m) DevExpress.XtraEditors.TextBoxMaskBox.WndProc(Message& msg) System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) System.Windows.Forms .NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)