private void partsGridControl_DoubleClick(object sender, EventArgs e) { var selected = maintenancePartsBindingSource.Current as MaintenancePart; var dialog = new MaintenancePartEdit(); dialog.ShowObject(selected); dialog.ShowDialog(this); }
private void addPartBarButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var dialog = new MaintenancePartEdit(); dialog.ShowObject(null); var result = dialog.ShowDialog(this); if (result == DialogResult.OK) { var item = dialog.GetCurrentObject(); this.maintenance.MaintenanceParts.Add(item); } }