private void gridView_RowCellClick(object sender, RowCellClickEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { GridFormatRuleMenuItems items = new GridFormatRuleMenuItems(gridView, e.Column, formatRulesMenu.Items); if (items.Count > 0) { MenuManagerHelper.ShowMenu(formatRulesMenu, gridControl.LookAndFeel, gridControl.MenuManager, gridControl, new Point(e.X, e.Y)); } } }
private void gridView_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { string Serialnumber, customer, item = "", sql = ""; if (e.Column.FieldName == "抽样流水号") { Serialnumber = gridView.GetFocusedRowCellValue("抽样流水号").ToString(); customer = gridView.GetFocusedRowCellValue("客户").ToString(); try { //if (customer.Contains("F1")) //{ // exportF1(Serialnumber); //} //else //{ // export(Serialnumber); //} export(Serialnumber); } catch (Exception ex) { MessageBox.Show("还没生成完整报表", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else if (e.Column.FieldName == "实际抽样数量") { Serialnumber = gridView.GetFocusedRowCellValue("抽样流水号").ToString(); sql = @" select item from OQC_TestListNew where serialnumber = '" + Serialnumber + "' "; DataTable dt = DbAccess.SelectBySql(sql).Tables[0]; if (dt != null && dt.Rows.Count > 0) { item = dt.Rows[0]["item"].ToString(); OQCSampleList OL = new OQCSampleList(item); DialogResult dr = OL.ShowDialog(); } else { MessageBox.Show("没有抽样数据!", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { GridFormatRuleMenuItems items = new GridFormatRuleMenuItems(gridView, e.Column, formatRulesMenu.Items); if (items.Count > 0) { MenuManagerHelper.ShowMenu(formatRulesMenu, gridControl.LookAndFeel, gridControl.MenuManager, gridControl, new Point(e.X, e.Y)); } } }
public bool ShowEntityMeny(Point pt, int rowHandle) { var entity = view.GetRow(rowHandle) as TEntity; if (entity != null) { var rowMenu = CreateEntityMenu(entity); MenuManagerHelper.ShowMenu(rowMenu, view.GridControl.LookAndFeel, view.GridControl.MenuManager, view.GridControl, pt); return(true); } return(false); }
private void view_MouseDown(object sender, MouseEventArgs e) { // Für CardView und LayoutView gibt es leider kein GridMenu-Event. if (e.Button != MouseButtons.Right) { return; } bool showMenu = false; if (_view is CardView) { CardHitInfo hi = (_view as CardView).CalcHitInfo(e.Location); showMenu = (hi.InCard); } else if (_view is LayoutView) { LayoutViewHitInfo hi = (_view as LayoutView).CalcHitInfo(e.Location); showMenu = (hi.InCard); } if (!showMenu) { return; } var dxMenu = new DXPopupMenu(); createMenuItems(dxMenu); GridControl gc = _view.GridControl; MenuManagerHelper.ShowMenu(dxMenu, gc.LookAndFeel, null, gc, e.Location); //// LayoutViewHitInfo hi = -.CalcHitInfo(GridControl1.PointToClient(p)) //// } //// dxMenu.Items.Add(New DXMenuItem("Item1")) //// dxMenu.Items.Add(New DXMenuItem("Item2")) //// Dim p As Point = Control.MousePosition //// Dim view As LayoutView = CType(sender, LayoutView) //// Dim hi As LayoutViewHitInfo = view.CalcHitInfo(GridControl1.PointToClient(p)) //// If hi.HitTest = LayoutViewHitTest.CardCaption Then //// MenuManagerHelper.ShowMenu(dxMenu, GridControl1.LookAndFeel, GridControl1, Nothing, ////GridControl1.PointToClient(p)) //// End If //// End Sub }
/// <summary> /// Present a popup menu with all pages to select a page to move to. /// </summary> private void onTabControlCustomHeaderButtonClick(object sender, CustomHeaderButtonEventArgs e) { var popupMenu = new DXPopupMenu { MenuViewType = MenuViewType.Menu }; foreach (XtraTabPage page in _tabControl.TabPages) { var menuitem = new DXMenuItem(page.Text); menuitem.Click += onPageListMenuItemClick; menuitem.Tag = popupMenu; if (page.Image != null) { menuitem.Image = page.Image; } popupMenu.Items.Add(menuitem); } var menuPos = _tabControl.PointToClient(MousePosition); MenuManagerHelper.ShowMenu(popupMenu, _tabControl.LookAndFeel, barManager, _tabControl, menuPos); }
private void onTabControlCustomHeaderButtonClick() { var popupMenu = new DXPopupMenu { MenuViewType = MenuViewType.Menu }; foreach (XtraTabPage page in importerTabControl.TabPages) { var menuitem = new DXMenuItem(page.Text); menuitem.Click += (s, a) => OnEvent(onPageListMenuItemClick, s, a); menuitem.Tag = popupMenu; if (page.Image != null) { menuitem.Image = page.Image; } popupMenu.Items.Add(menuitem); } var menuPos = importerTabControl.PointToClient(MousePosition); MenuManagerHelper.ShowMenu(popupMenu, importerTabControl.LookAndFeel, null, importerTabControl, menuPos); }
void Chart_MouseUp(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Right) { return; } object[] hitObjects = ChartControl.HitTest(e.X, e.Y); foreach (object hitObject in hitObjects) { if (hitObject is Axis || hitObject is Legend || hitObject is ChartControl) { DXPopupMenu popupMenu = ConstructPopupMenu(hitObject, ChartControl); MenuManagerHelper.ShowMenu( popupMenu, LookAndFeel, MenuManager, ChartControl, new Point(e.X, e.Y)); break; } } }
void IDXMenuManager.ShowPopupMenu(DXPopupMenu menu, Control control, Point pos) { MenuManagerHelper.ShowMenu(menu, LookAndFeel, fMenuManager, control, pos); }