private void menuNewDriver_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var manager = DriverManager.CreateNew(); using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager)) { if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { int index = gridViewDrivers.TopRowIndex; btnSearch_Click(this, EventArgs.Empty); gridViewDrivers.TopRowIndex = index; } } }
void gridViewDrivers_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { var row = gridViewDrivers.GetRow(e.RowHandle) as DriverModel; if (row == null) { return; } if (e.Clicks == 2) { if (this.Manager.IsFinder) { this.Manager.ActiveDriver = row; this.DialogResult = System.Windows.Forms.DialogResult.Yes; this.Close(); } else { var manager = DriverManager.CreateEdit(row.DriverID); using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager)) { form.ShowDialog(); RefreshDrivers(); } } } else if (e.Column.Name == col_Edit.Name) { var manager = DriverManager.CreateEdit(row.DriverID); using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager)) { form.ShowDialog(); RefreshDrivers(); } } }
void gridViewDrivers_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { var row = gridViewDrivers.GetRow(e.RowHandle) as DriverModel; if (row == null) return; if (e.Clicks == 2) { if (this.Manager.IsFinder) { this.Manager.ActiveDriver = row; this.DialogResult = System.Windows.Forms.DialogResult.Yes; this.Close(); } else { var manager = DriverManager.CreateEdit(row.DriverID); using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager)) { form.ShowDialog(); RefreshDrivers(); } } } else if (e.Column.Name == col_Edit.Name) { var manager = DriverManager.CreateEdit(row.DriverID); using (XF_DriverNewEdit form = new XF_DriverNewEdit(manager)) { form.ShowDialog(); RefreshDrivers(); } } }