protected override void AddObject() { CodeEditWindow form = new CodeEditWindow(2, CharacterCasing.Upper, false); form.FormClosed += (o, e) => { if (form.DialogResult == System.Windows.Forms.DialogResult.OK) { T_MaterailType matType = new T_MaterailType() { Code = form.Code, Desc = form.Desc }; _Proxy.AddMatType(matType); this.gvCode.RefreshData(); } }; form.ShowDialog(); }