private void gridView_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e) { try { if (e.HitInfo.InRow) { GridView view = sender as GridView; view.FocusedRowHandle = e.HitInfo.RowHandle; Meni.Show(view.GridControl, e.Point); } } catch (DbUpdateException ex) { if (ex.InnerException != null) { if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint")) { MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\""); } } } catch (Exception ex) { MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\""); } }
private void gridView_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e) { if (e.HitInfo.InRow) { GridView view = sender as GridView; view.FocusedRowHandle = e.HitInfo.RowHandle; Meni.Show(view.GridControl, e.Point); } }