void BWSGridControl_ShowGridMenu(object sender, DevExpress.XtraGrid.Views.Grid.GridMenuEventArgs e) { if (e.MenuType == GridMenuType.Column) { GridViewColumnMenu menu = e.Menu as GridViewColumnMenu; if (menu.Column != null) { string sMenuCaption1 = LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "ShowFooter"); if (((GridView)this.MainView).OptionsView.ShowFooter) { sMenuCaption1 = LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "HideFooter"); } string sMenuCaption2 = LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "ShowGroupFooter"); if (((GridView)this.MainView).GroupFooterShowMode == DevExpress.XtraGrid.Views.Grid.GroupFooterShowMode.VisibleIfExpanded) { sMenuCaption2 = LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "HideGroupFooter"); } DXMenuItem dx5 = new DXMenuItem(sMenuCaption1, ShowFooter); dx5.BeginGroup = true; menu.Items.Add(dx5); DXMenuItem dx6 = new DXMenuItem(sMenuCaption2, ShowGroupFooter); menu.Items.Add(dx6); DXMenuItem dx1 = new DXMenuItem(LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "SaveToExcel"), SaveAsExcel, Sunrise.ERP.Controls.Properties.Resources.excel.ToBitmap()); dx1.BeginGroup = true; menu.Items.Add(dx1); DXMenuItem dx2 = new DXMenuItem(LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "SaveToWord"), SaveAsWord, Sunrise.ERP.Controls.Properties.Resources.word.ToBitmap()); menu.Items.Add(dx2); DXMenuItem dx3 = new DXMenuItem(LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "SaveToHtml"), SaveAsHtml); menu.Items.Add(dx3); DXMenuItem dx4 = new DXMenuItem(LangCenter.Instance.GetControlLangInfo("SunriseGridControl", "SaveToPdf"), SaveAsPdf, Sunrise.ERP.Controls.Properties.Resources.pdf.ToBitmap()); menu.Items.Add(dx4); } } }
void ItemClick(object sender, EventArgs e) { DXMenuItem item = sender as DXMenuItem; PivotGridField field = item.Tag as PivotGridField; field.SummaryDisplayType = (PivotSummaryDisplayType)Enum.Parse(typeof(PivotSummaryDisplayType), item.Caption); }
void BWSGridControl_ShowGridMenu(object sender, DevExpress.XtraGrid.Views.Grid.GridMenuEventArgs e) { if (e.MenuType == GridMenuType.Column) { GridViewColumnMenu menu = e.Menu as GridViewColumnMenu; if (menu.Column != null) { string sMenuCaption1 = "显示脚注"; if (((GridView)this.MainView).OptionsView.ShowFooter) { sMenuCaption1 = "隐藏脚注"; } string sMenuCaption2 = "显示分组脚注"; if (((GridView)this.MainView).GroupFooterShowMode == DevExpress.XtraGrid.Views.Grid.GroupFooterShowMode.VisibleIfExpanded) { sMenuCaption2 = "隐藏分组脚注"; } DXMenuItem dx5 = new DXMenuItem(sMenuCaption1, ShowFooter); dx5.BeginGroup = true; menu.Items.Add(dx5); DXMenuItem dx6 = new DXMenuItem(sMenuCaption2, ShowGroupFooter); menu.Items.Add(dx6); DXMenuItem dx1 = new DXMenuItem("保存为Excel文件", SaveAsExcel, BWS.ERP.Controls.Properties.Resources.excel.ToBitmap()); dx1.BeginGroup = true; menu.Items.Add(dx1); DXMenuItem dx2 = new DXMenuItem("保存为Word文件", SaveAsWord, BWS.ERP.Controls.Properties.Resources.word.ToBitmap()); menu.Items.Add(dx2); DXMenuItem dx3 = new DXMenuItem("保存为Html文件", SaveAsHtml); menu.Items.Add(dx3); DXMenuItem dx4 = new DXMenuItem("保存为Pdf文件", SaveAsPdf, BWS.ERP.Controls.Properties.Resources.pdf.ToBitmap()); menu.Items.Add(dx4); } } }
private void InitMenu() { foreach (DXMenuItem item in Menu.Items) { if (item.Caption != "&Copy") { item.Visible = false; item.Enabled = false; } } _miCopyPrimaryKey = new DXMenuItem("Copy ID", OnCopyPrimaryKeyClick, Images.clipboard_copy_16x16) { Enabled = false }; Menu.Items.Add(_miCopyPrimaryKey); _miRefresh = new DXMenuItem("Refresh", OnRefreshRecordClick, Images.refresh_update_16x16) { Enabled = false }; Menu.Items.Add(_miRefresh); _miEdit = new DXMenuItem("Edit", OnEditRecordClick, Images.tool_pencil_16x16) { Enabled = false }; Menu.Items.Add(_miEdit); }
/// <summary> /// 点击表头右键菜单项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void att_gridview_GridMenuItemClick(object sender, EventArgs e) { DXMenuItem item = sender as DXMenuItem; if (item == null) { return; } GridView currentview = new GridView(); string[] itemstring = item.Tag.ToString().Split('/'); for (int i = 0; i < gridview_list.Count; i++) { if (gridview_list[i].Name == itemstring[2]) { currentview = gridview_list[i]; currentview.ClearSelection(); } } if (item != null && item.Caption == "选择当前列") { GridCell start = new GridCell(0, currentview.Columns[itemstring[1].Substring(3)]); GridCell end = new GridCell(currentview.RowCount - 1, currentview.Columns[itemstring[1].Substring(3)]); currentview.SelectCells(start, end); } }
void InitializeExportButton() { DXPopupMenu popup = new DXPopupMenu(); DXMenuItem item = new DXMenuItem(ExportFormat.Image.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Image); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Mht.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Mht); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Pdf.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Pdf); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Xls.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Xls); popup.Items.Add(item); item = new DXMenuItem(ExportFormat.Xlsx.ToString(), exportPopupItem_Click); exportHashtable.Add(item, ExportFormat.Xlsx); popup.Items.Add(item); ddbExport.DropDownControl = popup; ddbExport.Text = exportButtonTextBase + exportFormat.ToString(); }
void exportPopupItem_Click(object sender, EventArgs e) { DXMenuItem item = sender as DXMenuItem; ddbExport.Text = exportButtonTextBase + item.Caption; exportFormat = (ExportFormat)exportHashtable[item]; }
private void onPopupMenuShowing(object o, PopupMenuShowingEventArgs e) { var gridViewMenu = e.Menu; if (gridViewMenu == null) { return; } //we only show the context menu if we are selecting cells and nothing else if (e.HitInfo.HitTest != GridHitTest.RowCell) { return; } //we allow delete only if we have items that can be edited (depends on dev mode) var editableTemplates = SelectedTemplates.Where(_presenter.CanEdit).ToList(); if (!editableTemplates.Any()) { return; } var deleteSelectedMenuItem = new DXMenuItem(PKSimConstants.MenuNames.Delete, (obj, args) => _presenter.Delete(editableTemplates)) { SvgImage = ApplicationIcons.Delete }; gridViewMenu.Items.Insert(0, deleteSelectedMenuItem); }
private static void menuItemCustomize_Click(object sender, EventArgs e) {//自定义表格配置 DXMenuItem item = sender as DXMenuItem; GridView view = (GridView)item.Tag; new frmGridCustomize().Customize(view); }
private void CreateFavoritesMenu(DXPopupMenu menu) { for (int i = menu.Items.Count - 1; i >= 0; i--) { if (!object.Equals(menu.Items[i].Tag, StringId.TextEditMenuPaste)) { menu.Items.RemoveAt(i); } } if (_favorites != null && _favorites.Count > 0) { for (int i = 0; i < _favorites.Count; i++) { DXMenuItem menuItem = new DXMenuItem() { Tag = _favorites[i], Caption = _favorites[i].Content.Substring(0, Math.Min(_favorites[i].Content.Length, 50)), BeginGroup = (i == 0) }; menuItem.Click += (s, e) => ChangeMessage((s as DXMenuItem).Tag as WndMessage); menu.Items.Add(menuItem); } } }
/// <summary> /// Summary type selected /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AggregationTypeMenuItem_Click(object sender, EventArgs e) { PivotGridFieldMx f = PivotGridField; DXMenuItem mi = sender as DXMenuItem; string typeName = mi.Tag.ToString(); // tag is enum member name AggregationTypeDetail atd = AggregationTypeDetail.GetByTypeName(typeName, true); if (atd.IsGroupingType && atd.GroupingType == GroupingTypeEnum.NumericInterval) { DialogResult dr = NumericIntervalDialog.ShowDialog(f.Aggregation, UIMisc.MousePosition); //if (dr == DialogResult.Cancel) return; } f.Aggregation.SetFromTypeName(typeName); f.SyncDxAreaToMxRole(); // sync Dx area PivotGrid.RefreshData(); if (UpdateViewWhenGridControlChanges) { View.UpdateViewFieldsFromGridFields(); } return; }
//===========================Khu vực Xử Lý Đơn Đặt Hàng========================= private void gvDDH_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (Program.group == "CHINHANH" || Program.group == "USER") { int maNVLapDDH = 0; if (gvDDH.GetRowCellValue(datHangBDS.Position, "MANV") != null) { maNVLapDDH = int.Parse(gvDDH.GetRowCellValue(datHangBDS.Position, "MANV").ToString().Trim()); } if (e.MenuType == GridMenuType.Row) { GridViewMenu menu = e.Menu; DXMenuItem menuAddDDH = createMenuItem("Thêm DDH", Properties.Resources.add_16); menuAddDDH.Click += new EventHandler(menuAddDDH_Click); menu.Items.Add(menuAddDDH); if (maNVLapDDH == Program.manv) { DXMenuItem menuAddCTDDH = createMenuItem("Thêm chi tiết DDH", Properties.Resources.add_detail1_16); menuAddCTDDH.Click += new EventHandler(menuAddChiTietDDH_Click); menu.Items.Add(menuAddCTDDH); } DXMenuItem menuAddPN = createMenuItem("Thêm Phiếu Nhập", Properties.Resources.add_detail2_16); menuAddPN.Click += new EventHandler(menuAddPN_Click); menu.Items.Add(menuAddPN); } } }
private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.Menu.Id == DevExpress.XtraScheduler.SchedulerMenuItemId.DefaultMenu) { // Hide the "Change View To" menu item. SchedulerPopupMenu itemChangeViewTo = e.Menu.GetPopupMenuById(SchedulerMenuItemId.SwitchViewMenu); itemChangeViewTo.Visible = false; // Remove unnecessary items. e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewAllDayEvent); e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringAppointment); e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringEvent); // Disable the "New Recurring Appointment" menu item. e.Menu.DisableMenuItem(SchedulerMenuItemId.NewRecurringAppointment); // Find the "New Appointment" menu item and rename it. SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment); if (item != null) { item.Caption = "&Νέο ραντεβού"; } // Create a menu item for the Scheduler command. ISchedulerCommandFactoryService service = (ISchedulerCommandFactoryService)schedulerControl1.GetService(typeof(ISchedulerCommandFactoryService)); SchedulerCommand cmd = service.CreateCommand(SchedulerCommandId.SwitchToGroupByResource); SchedulerMenuItemCommandWinAdapter menuItemCommandAdapter = new SchedulerMenuItemCommandWinAdapter(cmd); DXMenuItem menuItem = (DXMenuItem)menuItemCommandAdapter.CreateMenuItem(DXMenuItemPriority.Normal); menuItem.BeginGroup = true; e.Menu.Items.Add(menuItem); } }
//DDH private void gvDDH_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e) { if (Program.group == "CHINHANH" || Program.group == "USER") { int maNVLapDDH = 0; if (gvDDH.GetRowCellValue(datHangBindingSource.Position, "MANV") != null) { maNVLapDDH = int.Parse(gvDDH.GetRowCellValue(datHangBindingSource.Position, "MANV").ToString().Trim()); } if (e.MenuType == GridMenuType.Row) { GridViewMenu menu = e.Menu; DXMenuItem menuAddDDH = createMenuItem("Thêm đơn đặt hàng", Properties.Resources.plus); menuAddDDH.Click += new EventHandler(menuAddDDH_Click); menu.Items.Add(menuAddDDH); if (maNVLapDDH == Program.manv) { DXMenuItem menuAddCTDDH = createMenuItem("Thêm chi tiết ĐĐH", Properties.Resources.inventory__3_); menuAddCTDDH.Click += new EventHandler(menuAddChiTietDDH_Click); menu.Items.Add(menuAddCTDDH); } DXMenuItem menuAddPN = createMenuItem("Thêm Phiếu Nhập", Properties.Resources.packing_list); menuAddPN.Click += new EventHandler(menuAddPN_Click); menu.Items.Add(menuAddPN); } } }
private void ChangeFixAction(object sender, EventArgs e) { DXMenuItem mi = (DXMenuItem)sender; IndexOp op = Utils.GetValueFromDescription <IndexOp>(mi.Caption); UpdateFixAction(op); }
private DXMenuItem[] CreateMenuItemsDownloadPopup() { DXMenuItem[] result = new DXMenuItem[] { new DXMenuItem("Ignore selected version(s)", ItemIgnoreVersion_Click) }; return(result); }
/// <summary> /// Добавить в меню пункты по выбору способа выделения ячеек /// </summary> /// <param name="menu">Меню</param> /// <param name="selectCustom">Метод для обработки случая выборки нескольких ячеек</param> /// <param name="selectRow">Метод для обработки случая выборки нескольких строк</param> /// <param name="selectRows">Метод для обработки случая выборки одной строки</param> public static void DXCreateSelectSelectionMenu(DXPopupMenu menu, EventHandler selectCustom, EventHandler selectRow, EventHandler selectRows) { var dxsmiSelect = new DXSubMenuItem("Способы выделения ячеек") { Image = Resources.table_select }; var dxmiSelectRows = new DXMenuItem("Колонка для выделения") { Image = Resources.check_box_list }; var dxmiSelectCustom = new DXMenuItem("Выделение нескольких ячеек") { Image = Resources.table_select_group }; var dxmiSelectRow = new DXMenuItem("Выделение строк") { Image = Resources.table_select_row }; dxmiSelectCustom.Click += selectCustom; dxmiSelectRow.Click += selectRow; dxmiSelectRows.Click += selectRows; dxsmiSelect.Items.Add(dxmiSelectRow); dxsmiSelect.Items.Add(dxmiSelectRows); dxsmiSelect.Items.Add(dxmiSelectCustom); menu.Items.Add(dxsmiSelect); }
private void onPopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.Menu == null) { return; } if (e.MenuType != PivotGridMenuType.HeaderArea) { return; } var copySelectionMenu = new DXMenuItem(Captions.CopySelection, clickCopySelectionMenuItem, ApplicationIcons.CopySelection) { Shortcut = Shortcut.CtrlC }; var copyAllMenu = new DXMenuItem(Captions.CopyTable, clickCopyTableMenuItem, ApplicationIcons.Copy) { Shortcut = Shortcut.CtrlShiftC }; e.Menu.Items.Clear(); e.Menu.Items.Insert(0, copySelectionMenu); e.Menu.Items.Insert(1, copyAllMenu); }
void InitializeMenuItems() { DXMenuItem itemEdit = new DXMenuItem("Sửa ứng viên", ItemEdit_Click, DXMenuItemPriority.High); DXMenuItem itemDelete = new DXMenuItem("Xóa ứng viên", ItemDelete_Click, DXMenuItemPriority.Normal); menuItems = new DXMenuItem[] { itemEdit, itemDelete }; }
private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.Menu.Id == DevExpress.XtraScheduler.SchedulerMenuItemId.DefaultMenu) { // Hide the "Change View To" menu item. SchedulerPopupMenu itemChangeViewTo = e.Menu.GetPopupMenuById(SchedulerMenuItemId.SwitchViewMenu); itemChangeViewTo.Visible = false; // Remove unnecessary items. e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewAllDayEvent); // Disable the "New Recurring Appointment" menu item. e.Menu.DisableMenuItem(SchedulerMenuItemId.NewRecurringAppointment); // Find the "New Appointment" menu item and rename it. SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment); if (item != null) { item.Caption = "&New Meeting"; item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg"); } // Create a menu item for the Scheduler command. ISchedulerCommandFactoryService service = schedulerControl1.GetService <ISchedulerCommandFactoryService>(); SchedulerCommand cmd = service.CreateCommand(SchedulerCommandId.SwitchToGroupByResource); SchedulerMenuItemCommandWinAdapter menuItemCommandAdapter = new SchedulerMenuItemCommandWinAdapter(cmd); DXMenuItem menuItem = (DXMenuItem)menuItemCommandAdapter.CreateMenuItem(DXMenuItemPriority.Normal); menuItem.BeginGroup = true; e.Menu.Items.Add(menuItem); // Insert a new item into the Scheduler popup menu and handle its click event. e.Menu.Items.Add(new SchedulerMenuItem("Click me!", MyClickHandler)); } }
//===========================Khu vực Xử Lý Phiếu Xuất=========================== private void gvPhieuXuat_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (Program.group == "CHINHANH" || Program.group == "USER") { int maNVLapPX = 0; if (gvPhieuXuat.GetRowCellValue(phieuXuatBDS.Position, "MANV") != null) { maNVLapPX = int.Parse(gvPhieuXuat.GetRowCellValue(phieuXuatBDS.Position, "MANV").ToString().Trim()); } if (e.MenuType == GridMenuType.Row) { GridViewMenu menu = e.Menu; DXMenuItem menuAddPX = createMenuItem("Thêm Phiếu Xuất", Properties.Resources.add_16); menuAddPX.Click += new EventHandler(menuAddPX_Click); menu.Items.Add(menuAddPX); if (maNVLapPX == Program.manv) { DXMenuItem menuAddCTPX = createMenuItem("Thêm chi tiết Phiếu Xuất", Properties.Resources.add_detail1_16); menuAddCTPX.Click += new EventHandler(menuAddCTPX_Click); menu.Items.Add(menuAddCTPX); } } } }
private void DevIncludeM_Click(object sender, EventArgs e) { DXMenuItem meanuItem = (DXMenuItem)sender; TaskFieldRegister register = new TaskFieldRegister(meanuItem.Tag, "GISDATA_TASK"); register.ShowDialog(); }
void printPopupItem_Click(object sender, EventArgs e) { DXMenuItem item = sender as DXMenuItem; ddbPrint.Text = printButtonTextBase + item.Caption; printType = (PrintType)printHashtable[item]; }
private static void OnTreeListPopupMenuShowing(object sender, DevExpress.XtraTreeList.PopupMenuShowingEventArgs e) { var tree = sender as TreeList; var hitInfo = tree.CalcHitInfo(e.Point); if (hitInfo.Column.OptionsColumn.AllowMoveToCustomizationForm) { int index = 0; for (; index < e.Menu.Items.Count - 1; index++) { var it = e.Menu.Items[index]; if (TreeListStringId.MenuColumnColumnCustomization.Equals(it.Tag)) { index++; break; } } var item = new DXMenuItem(XtraStrings.Get("GridStringId.MenuColumnRemoveColumn", "Remove column"), RemoveTreeListColumn); { e.Menu.Items[index - 1].BeginGroup = false; e.Menu.Items.Insert(index - 1, item); e.Menu.Items[index - 1].BeginGroup = true; } item.Tag = hitInfo.Column; } }
void OnFilterControlPopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.MenuType == FilterControlMenuType.Group) { // Hide commands e.Menu.Remove(GroupType.NotAnd); e.Menu.Remove(GroupType.NotOr); //Locate and then disable and rename commands. e.Menu.Find(StringId.FilterMenuGroupAdd).Enabled = false; e.Menu.Find(StringId.FilterMenuClearAll).Caption = "Remove All"; } // Hide all operators except Equals and DoesNotEqual for the "ID" field if (e.MenuType == FilterControlMenuType.Clause) { ClauseNode node = e.CurrentNode as ClauseNode; if (node.Property.Name == "ID") { DXMenuItem itemEqual = e.Menu.Find(ClauseType.Equals); DXMenuItem itemNotEqual = e.Menu.Find(ClauseType.DoesNotEqual); for (int i = e.Menu.Items.Count - 1; i >= 0; i--) { DXMenuItem item = e.Menu.Items[i]; if (!item.Equals(itemEqual) && !item.Equals(itemNotEqual)) { item.Visible = false; } } } } }
public DXMenuItem PrintPreview(GridColumn column, string caption) { var item = new DXMenuItem("Print Preview", PrintPrev_Click); ActiveCol = column; return item; }
public DXMenuItem ExportToExcel(GridColumn column, string caption) { var item = new DXMenuItem("Export To Excel", Export_To_Excel); ActiveCol = column; return item; }
public DXMenuItem FixedCol(GridColumn column, string caption) { var item = new DXMenuItem(caption, FixedCol_Click); ActiveCol = column; return item; }
private void OnItemsClick(object sender, EventArgs e) { DXMenuItem menuItem = (DXMenuItem)sender; string t = "0"; if (menuItem.Caption == "Firma Çeki") { t = "0"; } else if (menuItem.Caption == "Müşteri Çeki") { t = "1"; } else { t = "2"; } frmCekGirisi CekGirisi = new frmCekGirisi(t); CekGirisi.ShowDialog(); ceklistesi(); //Debug.WriteLine(menuItem.Caption + " clicked"); }
public DXMenuItem HeadingChanger(GridColumn column, string caption) { var item = new DXMenuItem("Change Column Heading", OnChangeClick); ActiveCol = column; return item; }
private void gridView1_MouseDown(object sender, MouseEventArgs e) { GridView view = sender as GridView; // obtaining hit info GridHitInfo hitInfo = view.CalcHitInfo(new Point(e.X, e.Y)); if (((e.Button & MouseButtons.Right) != 0) && (hitInfo.InRow) && (!view.IsGroupRow(hitInfo.RowHandle))) { // switching focus view.FocusedRowHandle = hitInfo.RowHandle; // showing the custom context menu ViewMenu menu = new ViewMenu(view); { { DXMenuItem menuItem = new DXMenuItem("RefreshRow", new EventHandler(this.RefreshFocusedRow)); menuItem.Tag = view; menu.Items.Add(menuItem); } { DXMenuItem menuItem = new DXMenuItem("DeleteRow", new EventHandler(this.DeleteFocusedRow)); menuItem.Tag = view; menu.Items.Add(menuItem); } menu.Show(hitInfo.HitPoint); } } }
void approvalsGridView_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { DXPopupMenu popupMenu = (DXPopupMenu)e.Menu; if (popupMenu == null) return; popupMenu.Items.Clear(); DXMenuItem item = new DXMenuItem("Approve", new EventHandler(this.ApproveShortSaleApproval)); popupMenu.Items.Add(item); }
public AddDeleteDXPopupMenu() { LoadImages(); this.Items.Clear(); this.miAdd = this.CreateMenuItem("新增(&A)", new EventHandler(this.OnClickedAdd), imageList.Images[0], "Add"); this.Items.Add(this.miAdd); this.miDelete = this.CreateMenuItem(Localizer.Active.GetLocalizedString(StringId.TextEditMenuDelete), new EventHandler(this.OnClickedDelete), imageList.Images[1], "Delete"); this.Items.Add(this.miDelete); }
public static void RaisePopupMenuShowingX(this IXpandFilterControl filterControl,PopupMenuShowingEventArgs e){ if (e.MenuType == FilterControlMenuType.Clause && filterControl.ModelMembers != null){ var criteriaOperator = new XpandNodeToCriteriaProcessor().Process(e.CurrentNode); var operandProperty = criteriaOperator.GetOperators().OfType<OperandProperty>().First(); var modelMember =filterControl.ModelMembers.Cast<IModelMemberFullTextContains>().FirstOrDefault(member => member.FullText && member.Name == operandProperty.PropertyName); if (modelMember != null){ var dxMenuItem = new DXMenuItem(ClauseTypeEnumHelper.GetMenuStringByClauseType(ClauseTypeEnumHelper.FullText),filterControl.OnClauseClick){Tag = ClauseTypeEnumHelper.FullText}; e.Menu.Items.Add(dxMenuItem); } } }
/// <summary> /// 附加其它自定义菜单 /// </summary> public static void AddMenuItem(GridView view, string menuText, Image image, EventHandler onclick, bool beginGroup) { if (menuText == "-") throw new Exception("不支持分隔条,请使用BeginGroup属性!"); if (!IsInstalled(view)) _grids.Add(view, new Hashtable()); Hashtable hs = (Hashtable)_grids[view]; if (!hs.ContainsKey(menuText)) { DXMenuItem item = new DXMenuItem(menuText); item.Click += new EventHandler(onclick); item.Image = image; item.Tag = view;//保存GridView引用,在DXMenuItem事件内快速找到GridView item.BeginGroup = beginGroup; hs.Add(menuText, item); } }
void View_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.MenuType == GridMenuType.Column) { var view = (SmartGridView)sender; var columns = FieldNames.Select(view.Columns.ColumnByFieldName); var newVisiblity = !columns.First().Visible; var caption = (newVisiblity ? "Show " : "Hide ") + Name; var item = new DXMenuItem(caption, delegate { foreach (var col in columns) col.Visible = newVisiblity; }, image: null); e.Menu.Items.Add(item); } }
private DXCustomMenuCreator(EditorContainer _editor, ref DXPopupMenu _menu) { editor = _editor; menu = _menu; controlForm = editor.FindForm(); dxsmiSaved = new DXSubMenuItem("Сохраненные состояния") { Image = Resources.layout_save }; bbiDeleteStates = new DXMenuItem("Удалить выбранные") { Image = Resources.Remove }; dxsmiRemove = new DXSubMenuItem("Удалить состояния") { Image = Resources.layout_delete }; }
protected virtual void CustomMenuPopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { //При вызове обычного меню на клике по строке switch (e.MenuType) { case GridMenuType.User: case GridMenuType.Row: RepositoryItem repository = null; //Показать меню для выбора значения выделенных строк if (OptionsBehavior.Editable && OptionsCustomization.ShowSelectedRowMenu && FocusedColumn != null && FocusedColumn.OptionsColumn.ShowEditorInPopupMenu && FocusedColumn.OptionsColumn.AllowEdit && !FocusedColumn.OptionsColumn.ReadOnly && SelectedRowsCount > 1) { repository = DXCustomMenuCreator.DXCreateBarItemByFocusedColumn(FocusedColumn); var buttonRepository = repository as RepositoryItemButtonEdit; if (buttonRepository != null && buttonRepository.Buttons.Count > 1) { buttonRepository.ButtonClick += ClearSelectedRowsFromMenu; } } if (CustomPopupMenu != null) { AddButtonInPopupMenu(); DeleteButtonInPopupMenu(); var link = CustomPopupMenu.ItemLinks .OfType<BarEditItemLink>() .FirstOrDefault(bei => bei.Item.Id == -1); if (link != null) { CustomPopupMenu.RemoveLink(link); } if (repository != null) { var bei = new BarEditItem { Edit = repository, Id = -1, Tag = FocusedColumn }; bei.EditValueChanged += SelectedRowEditValueChanged; CustomPopupMenu.AddItem(bei); } } else { var dxmAdd = new DXMenuItem(AddCaption, AddRow, Resources.Add); var dxmRemove = new DXMenuItem(RemoveCaption, RemoveRows, Resources.Remove); if (e.MenuType == GridMenuType.User && e.Menu == null) e.Menu = new GridViewMenu(this); if (OptionsCustomization.AllowAdd) e.Menu.Items.Add(dxmAdd); if (OptionsCustomization.AllowDelete) { e.Menu.Items.Add(dxmRemove); dxmRemove.Enabled = SelectedRowsCount != 0; } if (repository != null) { var bei = new DXEditMenuItem { Edit = repository, Tag = FocusedColumn }; bei.EditValueChanged += SelectedRowEditValueChanged; e.Menu.Items.Add(bei); } } break; case GridMenuType.Column: DXPopupMenu menu = e.Menu as GridViewColumnMenu; if (menu == null) { return; } DXCustomMenuCreator.HideCustomizationColumns(menu); DXCustomMenuCreator.DXCreateSelectSelectionMenu(menu, CustomItemClick, RowItemClick, CheckboxColumnItemClick); DXCustomMenuCreator.DXCreateLayoutMenuItems(GridControl, ref menu); break; } }
//public static void CreateGridContextMenu(GridView view, PopupMenuShowingEventArgs e, bool pDisplayNurtureEventMenus = false, AdditionalMenuItems pItems = null) //{ // // Check whether there are data in the grid. // if (view.Columns.Count <= 0 && view.RowCount <= 0) return; // // Check whether a row or user is right-clicked. // if (e.MenuType == GridMenuType.Row || e.MenuType == GridMenuType.User) // { // int rowHandle = e.HitInfo.RowHandle; // if (e.MenuType == GridMenuType.User) // { // if (e.Menu == null) // { // e.Menu = new GridViewMenu(view); // } // } // e.Menu.Items.Clear(); // /** // * menus for nurture event feature must come first before other menus. // */ // if (pDisplayNurtureEventMenus) // { // if (pItems != null) // { // if (pItems.SelectContact) // e.Menu.Items.Add(CreateSelectContact()); // if (pItems.LoadNurtureEvent) // e.Menu.Items.Add(CreateLoadNurtureEvent()); // if (pItems.EditEvent) // e.Menu.Items.Add(CreateEditEvent()); // } // } // // Add a submenu with a single menu item. // e.Menu.Items.Add(CreateCopyText(view, rowHandle)); // e.Menu.Items.Add(CreateExportMenu(view, rowHandle)); // e.Menu.Items.Add(CreatePrintingMenu(view, rowHandle)); // //if (view.Name == "gvEventLog") // //{ // // DXMenuItem saveAudioToLocationMenu = SaveAudioToLocation(view, rowHandle); // // if (saveAudioToLocationMenu != null) // // e.Menu.Items.Add(saveAudioToLocationMenu); // //} // } //} private static DXMenuItem CreateLoadCompanyView(GridView view, int rowHandle, DevExpress.XtraEditors.XtraUserControl caller) { var menuitem = new DXMenuItem { Caption = "Load Company View", Shortcut = Shortcut.CtrlC }; menuitem.Tag = new RowInfo(view, rowHandle); menuitem.Click += new EventHandler((sender, args) => LoadCompanyView(sender, null, caller)); return menuitem; }
// Create menu items. // This method is automatically called by the menu's public Init method. protected override void CreateItems() { Items.Clear(); DXMenuItem itemTemp = null; itemTemp = new DXMenuItem("选择");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//选择 itemTemp.Tag = new MenuInfo(popUpMenuStripName.choose); Items.Add(itemTemp); itemTemp = new DXMenuItem("不选");//, new EventHandler(test), GridMenuImages.Column.Images[0]) ;//不选 itemTemp.Tag = new MenuInfo(popUpMenuStripName.unChoose); Items.Add(itemTemp); itemTemp = new DXMenuItem("全选");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//全选 itemTemp.Tag = new MenuInfo(popUpMenuStripName.chooseAll); itemTemp.BeginGroup = true; Items.Add(itemTemp); itemTemp = new DXMenuItem("全不选");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//全不选 itemTemp.Tag = new MenuInfo(popUpMenuStripName.unChooseAll); Items.Add(itemTemp); itemTemp = new DXMenuItem("新增");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//新增 itemTemp.Tag = new MenuInfo(popUpMenuStripName.addNew); itemTemp.BeginGroup = true; if (imageList != null && imageList.Images.Count > 9) { itemTemp.Image = imageList.Images[9]; } Items.Add(itemTemp); itemTemp = new DXMenuItem("复制新增");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//复制新增 itemTemp.Tag = new MenuInfo(popUpMenuStripName.addCopyNew); if (imageList != null && imageList.Images.Count > 11) { itemTemp.Image = imageList.Images[11]; } Items.Add(itemTemp); //itemTemp = new DXMenuItem("删除");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//删除 //itemTemp.Tag = new MenuInfo(popUpMenuStripName.delete); //if (imageList != null && imageList.Images.Count > 10) //{ // itemTemp.Image = imageList.Images[10]; //} //Items.Add(itemTemp); itemTemp = new DXMenuItem("导出");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//另存为 itemTemp.Tag = new MenuInfo(popUpMenuStripName.saveAs); if (imageList != null && imageList.Images.Count > 6) { itemTemp.Image = imageList.Images[6]; } itemTemp.BeginGroup = true; Items.Add(itemTemp); itemTemp = new DXMenuItem("复制"); itemTemp.Tag = new MenuInfo(popUpMenuStripName.copySelectData); Items.Add(itemTemp); itemTemp = new DXMenuItem("复制行"); itemTemp.Tag = new MenuInfo(popUpMenuStripName.copySelectRows); Items.Add(itemTemp); itemTemp = new DXMenuItem("复制列"); itemTemp.Tag = new MenuInfo(popUpMenuStripName.copySelectCols); Items.Add(itemTemp); itemTemp = new DXMenuItem("设置列停靠"); itemTemp.Tag = new MenuInfo(popUpMenuStripName.setColumnFixed); Items.Add(itemTemp); //itemTemp = new DXMenuItem("保存配置");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//另存为 //itemTemp.Tag = new MenuInfo(popUpMenuStripName.saveConfig); //if (imageList != null && imageList.Images.Count > 8) //{ // itemTemp.Image = imageList.Images[8]; //} //Items.Add(itemTemp); //itemTemp = new DXMenuItem("刷新");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//另存为 //itemTemp.Tag = new MenuInfo(popUpMenuStripName.refresh); //if (imageList != null && imageList.Images.Count > 7) //{ // itemTemp.Image = imageList.Images[7]; //} //Items.Add(itemTemp); //itemTemp = new DXMenuItem("跳转");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//另存为 //itemTemp.Tag = new MenuInfo(popUpMenuStripName.gotoPage); //if (imageList != null && imageList.Images.Count > 12) //{ // itemTemp.Image = imageList.Images[12]; //} //Items.Add(itemTemp); //itemTemp = new DXMenuItem("过滤行");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//另存为 //itemTemp.Tag = new MenuInfo(popUpMenuStripName.gotoPage); //if (imageList != null && imageList.Images.Count > 4) //{ // itemTemp.Image = imageList.Images[4]; //} //Items.Add(itemTemp); //itemTemp = new DXMenuItem("分组");//, new EventHandler(test), GridMenuImages.Column.Images[0]);//另存为 //itemTemp.Tag = new MenuInfo(popUpMenuStripName.gotoPage); //if (imageList != null && imageList.Images.Count > 5) //{ // itemTemp.Image = imageList.Images[5]; //} //Items.Add(itemTemp); }
private static DXMenuItem CreateCopyText(GridView view, int rowHandle) { var menuitem = new DXMenuItem { Caption = "Copy Text", Shortcut = Shortcut.CtrlC }; menuitem.Tag = new RowInfo(view, rowHandle); menuitem.Click += new EventHandler(copyText_Click); return menuitem; }
public static DXMenuItem CreateRowSubMenu(GridView view, int rowHandle) { m_grv = view; DXSubMenuItem subMenu = new DXSubMenuItem("Báo cáo"); DXMenuItem menuItemReportXLS = new DXMenuItem("&Báo cáo XLS", new EventHandler(ExportXLSClick)); DXMenuItem menuItemReportPDF = new DXMenuItem("&Báo cáo PDF", new EventHandler(ExportPDFClick)); DXMenuItem menuItemReportHTML = new DXMenuItem("&Báo cáo HTML", new EventHandler(ExportHTMLClick)); DXMenuItem menuItemReportDOC = new DXMenuItem("&Báo cáo TXT", new EventHandler(ExportDOCClick)); subMenu.Items.Add(menuItemReportXLS); subMenu.Items.Add(menuItemReportPDF); subMenu.Items.Add(menuItemReportHTML); subMenu.Items.Add(menuItemReportDOC); return subMenu; }
public GridViewCustomMenu(GridEditControl gec, GridView view, PopupMenyType menuType) : base(view) { _mt = menuType; _gec = gec; //handlers eh_addItemClick = (s, e) => { _gec.addRow(); }; eh_remItemClick = (s, e) => { _gec.remRow(); }; //items addItem = new DXMenuItem("Add"); addItem.Click += eh_addItemClick; if(menuType == PopupMenyType.addRem) { remItem = new DXMenuItem("Del"); remItem.Click += eh_remItemClick; } }
private static DXMenuItem SaveAudioToLocation(GridView view, int rowHandle, object objOldAudioId) { //object objOldAudioId = view.GetFocusedRowCellValue("audio_id"); object objAudioId = view.GetFocusedRowCellValue("azure_blob_audio_id"); if (objAudioId == null && objOldAudioId == null) return null; var menuitem = new DXMenuItem { Caption = "Save Audio To Location", Shortcut = Shortcut.CtrlS }; //Create Save Audio To Location MenuItem with Click Event menuitem.Tag = new RowInfo(view, rowHandle); menuitem.Image = Resources.save17; menuitem.Click += delegate(object sender, EventArgs e) { using (SaveFileDialog dialog = new SaveFileDialog()) { //dialog.ShowNewFolderButton = false; //dialog.RootFolder = Environment.SpecialFolder.MyComputer; dialog.Filter = "MP3 file|*.mp3"; dialog.Title = "Save as"; dialog.FileName = "*.mp3"; if (dialog.ShowDialog() == DialogResult.OK) { WaitDialog.Show("Saving audio files...."); BrightVision.Windows.Azure.Storage.Blob.WindowsAzureStorageBlob wab = new BrightVision.Windows.Azure.Storage.Blob.WindowsAzureStorageBlob(); string WindowsAzureStorageBlobAccountName = ConfigManager.AppSettings["WindowsAzureStorageBlobAccountName"].ToString(); string WindowsAzureStorageBlobAccountKey = ConfigManager.AppSettings["WindowsAzureStorageBlobAccountKey"].ToString(); string WindowsAzureStorageBlobContainerName = ConfigManager.AppSettings["WindowsAzureStorageBlobContainerName"].ToString(); string strAudioId = ""; if (objOldAudioId != null && objAudioId == null) { strAudioId = objOldAudioId + "_.mp3"; WindowsAzureStorageBlobContainerName = ConfigManager.AppSettings["WindowsAzureStorageBlobContainerNameOld"].ToString(); } else { strAudioId = objAudioId + ".mp3"; } if (wab.InitialzeWindowsAzureStorage( WindowsAzureStorageBlobAccountName, WindowsAzureStorageBlobAccountKey, WindowsAzureStorageBlobContainerName ) ) { string msg = ""; if (wab.ProcessDownload(strAudioId, dialog.FileName, ref msg)) { NotificationDialog.Information("Success", "Successfully save audio file."); string argument = @"/select, " + dialog.FileName; System.Diagnostics.Process.Start("explorer.exe", argument); } else { if (!wab.IsBlobFileExist(strAudioId)) { NotificationDialog.Error("Error", "Blob file does not exist.\nPlease consult system administrator."); } else { NotificationDialog.Error("Error", "Unable save audio file.\nERROR: " + msg + "\nPlease consult system administrator."); } } } wab = null; WaitDialog.Close(); } } }; return menuitem; }
void pivotGridMaster_ShowMenu(object sender, PivotGridMenuEventArgs e) { if (e.MenuType != PivotGridMenuType.Header) return; DXMenuItem itemTotal = new DXMenuItem(); if (e.Field.TotalsVisibility == PivotTotalsVisibility.None) { itemTotal.Caption = "Hiện total (tổng)"; itemTotal.Tag = PivotTotalsVisibility.AutomaticTotals; } else { itemTotal.Caption = "Ẩn total (tổng)"; itemTotal.Tag = PivotTotalsVisibility.None; } itemTotal.Click += delegate(object senderr, EventArgs re) { e.Field.TotalsVisibility = (PivotTotalsVisibility)itemTotal.Tag; }; DXMenuCheckItem itemNoOrder = new DXMenuCheckItem("Không sắp xếp"); itemNoOrder.Checked = e.Field.SortMode == PivotSortMode.None; DXMenuCheckItem itemAsc = new DXMenuCheckItem("Sắp tăng dần"); itemAsc.Checked = e.Field.SortMode != PivotSortMode.None && e.Field.SortOrder == PivotSortOrder.Ascending; DXMenuCheckItem itemDesc = new DXMenuCheckItem("Sắp giảm dần"); itemDesc.Checked = e.Field.SortMode != PivotSortMode.None && e.Field.SortOrder == PivotSortOrder.Descending; itemNoOrder.CheckedChanged += delegate(object sendere, EventArgs ee) { e.Field.SortMode = PivotSortMode.None; }; itemAsc.CheckedChanged += delegate(object sendere, EventArgs ee) { e.Field.SortMode = PivotSortMode.Value; e.Field.SortOrder = PivotSortOrder.Ascending; }; itemDesc.CheckedChanged += delegate(object sendere, EventArgs ee) { e.Field.SortMode = PivotSortMode.Value; e.Field.SortOrder = PivotSortOrder.Descending; }; DXMenuItem itemSaveLayout = new DXMenuItem("Lưu hình dạng lưới"); DXMenuItem itemDeleteLayout = new DXMenuItem("Xóa hình dạng lưới đã lưu"); itemSaveLayout.Click += delegate(object senderr, EventArgs ee) { try { pivotGridMaster.SaveLayoutToXml(PivotLayoutName); } catch { } }; itemDeleteLayout.Click += delegate(object senderr, EventArgs ee) { try { string f = PivotLayoutName; if (File.Exists(f)) File.Delete(f); pivotGridMaster.BestFit(); } catch { } }; e.Menu.Items[0].BeginGroup = true; e.Menu.Items.Insert(0, itemDeleteLayout); e.Menu.Items.Insert(0, itemSaveLayout); itemSaveLayout.BeginGroup = true; e.Menu.Items.Insert(0, itemNoOrder); e.Menu.Items.Insert(0, itemDesc); e.Menu.Items.Insert(0, itemAsc); itemAsc.BeginGroup = true; e.Menu.Items.Insert(0, itemTotal); }
private void UpdateDeleteMenuItem(DXMenuItem item, EventArgs e) { item.Visible = false; }
private void UpdateClearMenuItem(DXMenuItem item, EventArgs e) { item.Enabled = (!this.Properties.FileDataReadOnly && !FileDataHelper.IsFileDataEmpty(this.FileData)); }
private void UpdateSaveOpenMenuItem(DXMenuItem item, EventArgs e) { item.Enabled = !FileDataHelper.IsFileDataEmpty(this.FileData); }
private void pivotGridControl1_ShowMenu(object sender, DevExpress.XtraPivotGrid.PivotGridMenuEventArgs e) { var pivoFfield = e.Field; #region TODO: temp nousing customize //DXMenuItem itemTotal = new DXMenuItem(); //if (pivoFfield.TotalsVisibility == PivotTotalsVisibility.None) //{ // itemTotal.Caption = "Hiện total (tổng)"; // itemTotal.Tag = PivotTotalsVisibility.AutomaticTotals; //} //else //{ // itemTotal.Caption = "Ẩn total (tổng)"; // itemTotal.Tag = PivotTotalsVisibility.None; //} //itemTotal.Click += delegate(object senderr, EventArgs re) //{ // pivoFfield.TotalsVisibility = (PivotTotalsVisibility)itemTotal.Tag; //}; //DXMenuCheckItem itemNoOrder = new DXMenuCheckItem("Không sắp xếp"); //itemNoOrder.Checked = pivoFfield.SortMode == PivotSortMode.None; //DXMenuCheckItem itemAsc = new DXMenuCheckItem("Sắp tăng dần"); //itemAsc.Checked = pivoFfield.SortMode != PivotSortMode.None && pivoFfield.SortOrder == PivotSortOrder.Ascending; //DXMenuCheckItem itemDesc = new DXMenuCheckItem("Sắp giảm dần"); //itemDesc.Checked = pivoFfield.SortMode != PivotSortMode.None && pivoFfield.SortOrder == PivotSortOrder.Descending; //itemNoOrder.CheckedChanged += delegate(object sendere, EventArgs ee) //{ // pivoFfield.SortMode = PivotSortMode.None; //}; //itemAsc.CheckedChanged += delegate(object sendere, EventArgs ee) //{ // pivoFfield.SortMode = PivotSortMode.Value; // pivoFfield.SortOrder = PivotSortOrder.Ascending; //}; //itemDesc.CheckedChanged += delegate(object sendere, EventArgs ee) //{ // pivoFfield.SortMode = PivotSortMode.Value; // pivoFfield.SortOrder = PivotSortOrder.Descending; //}; #endregion if (pivoFfield == null) { if (e.HitInfo != null && e.HitInfo.ValueInfo != null) { pivoFfield = e.HitInfo.ValueInfo.DataField; } } #region data field Menu if (pivoFfield != null) { #region DataArea Menu if (pivoFfield.Area == PivotArea.DataArea) { var subMenuSummaryTpe = new DXSubMenuItem("Kiểu thống kê"); foreach (PivotSummaryType sumaryType in Enum.GetValues(typeof (PivotSummaryType))) { string caption; switch (sumaryType) { case PivotSummaryType.Sum: caption = "Tổng"; break; case PivotSummaryType.Count: caption = "Đếm"; break; case PivotSummaryType.Average: caption = "Trung bình"; break; case PivotSummaryType.Min: caption = "Nhỏ nhất"; break; case PivotSummaryType.Max: caption = "Lớn nhất"; break; default: continue; } var item = new DXMenuCheckItem(caption) {Tag = sumaryType, Checked = pivoFfield.SummaryType== sumaryType}; item.CheckedChanged += delegate(object senderr, EventArgs ee) { var it = (DXMenuCheckItem) senderr; var type = (PivotSummaryType) it.Tag; pivoFfield.SummaryType = type; ; }; subMenuSummaryTpe.Items.Add(item); } subMenuSummaryTpe.BeginGroup = true; e.Menu.Items.Add(subMenuSummaryTpe); } #endregion } #endregion #region Common menu var itemSaveLayout = new DXMenuItem("Lưu hình dạng lưới"); var itemDeleteLayout = new DXMenuItem("Xóa hình dạng lưới đã lưu"); itemSaveLayout.Click += delegate(object senderr, EventArgs ee) { try { pivotGridControl1.SaveLayoutToXml(PivotLayoutName); } catch { } }; itemDeleteLayout.Click += delegate(object senderr, EventArgs ee) { try { string f = PivotLayoutName; if (File.Exists(f)) File.Delete(f); pivotGridControl1.ResumeLayout(true); pivotGridControl1.BestFit(); } catch { } }; var itemsCount = e.Menu.Items.Count; if (itemsCount > 0) { itemSaveLayout.BeginGroup = true; } e.Menu.Items.Add(itemSaveLayout); e.Menu.Items.Add(itemDeleteLayout); #endregion }
private void OnPreparePopupMenu(object sender, PreparePopupMenuEventArgs e) { e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringEvent); e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringAppointment); e.Menu.RemoveMenuItem(SchedulerMenuItemId.GotoToday); e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewAllDayEvent); e.Menu.RemoveMenuItem(SchedulerMenuItemId.GotoThisDay); e.Menu.RemoveMenuItem(SchedulerMenuItemId.GotoDate); e.Menu.RemoveMenuItem(SchedulerMenuItemId.SwitchViewMenu); e.Menu.RemoveMenuItem(SchedulerMenuItemId.LabelSubMenu); e.Menu.RemoveMenuItem(SchedulerMenuItemId.StatusSubMenu); e.Menu.RemoveMenuItem(SchedulerMenuItemId.DeleteAppointment); e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewAppointment); // Check if it's the default menu of a Scheduler. if (e.Menu.Id == SchedulerMenuItemId.DefaultMenu) { // Find the "New Appointment" menu item and rename it. // SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment); // if (item != null) item.Caption = "New..."; SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.OpenAppointment); if (item != null) item.Caption = "Open..."; //item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment); //if (item != null) item.Caption = "New..."; } DXMenuItem iDelete = new DXMenuItem("Delete..."); if (schedulerControl1.SelectedAppointments.Count > 0) { e.Menu.Items.Add(iDelete); iDelete.Click += new EventHandler(iDelete_Click); } }
private void grwInvoiceList_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { if (e.MenuType == GridMenuType.Row) { var menu = e.Menu; menu.Items.Clear(); var itemReload = new DXMenuItem("Nạp lại"); itemReload.Image = ImgCollection.Images["refresh2_16x16.png"]; itemReload.Shortcut = Shortcut.F5; itemReload.Click += itemReload_Click; menu.Items.Add(itemReload); var itemAdd = new DXMenuItem("Thêm"); itemAdd.BeginGroup = true; itemAdd.Image = ImgCollection.Images["new_16x16.png"]; itemAdd.Shortcut = Shortcut.CtrlN; itemAdd.Click += itemAdd_Click; menu.Items.Add(itemAdd); var itemEdit = new DXMenuItem("Sửa"); itemEdit.Image = ImgCollection.Images["edit_16x16.png"]; itemEdit.Shortcut = Shortcut.CtrlE; itemEdit.Click += itemEdit_Click; menu.Items.Add(itemEdit); var itemDelete = new DXMenuItem("Xóa"); itemDelete.Image = ImgCollection.Images["delete_16x16.png"]; itemDelete.Shortcut = Shortcut.CtrlDel; itemDelete.Click += itemDelete_Click; menu.Items.Add(itemDelete); } }
private static DXMenuItem CreateSelectContact() { var menuitem = new DXMenuItem { Caption = "Select Contact" }; menuitem.Click += new EventHandler(SelectContact_Click); return menuitem; }
private static DXMenuItem CreateExportMenu(GridView view, int rowHandle) { DXSubMenuItem subMenu = new DXSubMenuItem("Export"); DXMenuItem menuItemExport = new DXMenuItem("&Excel Workbook (*.xls)", new EventHandler(OnExportToExcelClick), BrightVision.Common.Resources.export_xls); menuItemExport.Tag = new RowInfo(view, rowHandle, ViewExportType.Excel2003); subMenu.Items.Add(menuItemExport); menuItemExport = new DXMenuItem("E&xcel Workbook (*.xlsx)", new EventHandler(OnExportToExcelClick), BrightVision.Common.Resources.export_excel); menuItemExport.Tag = new RowInfo(view, rowHandle, ViewExportType.Excel2007); subMenu.Items.Add(menuItemExport); menuItemExport = new DXMenuItem("&CSV (Comma Delimited) (*.csv)", new EventHandler(OnExportToExcelClick), BrightVision.Common.Resources.export_csv); menuItemExport.Tag = new RowInfo(view, rowHandle, ViewExportType.CSV); subMenu.Items.Add(menuItemExport); return subMenu; }
private static DXMenuItem CreatePrintingMenu(GridView view, int rowHandle) { DXSubMenuItem subMenu = new DXSubMenuItem("Print"); DXMenuItem menuItemPrinting = new DXMenuItem("&Preview", new EventHandler(onPrintingClick), BrightVision.Common.Resources.printer); menuItemPrinting.Tag = new RowInfo(view, rowHandle); subMenu.Items.Add(menuItemPrinting); return subMenu; }
private static DXMenuItem CreateEditEvent() { var menuitem = new DXMenuItem { Caption = "Edit Task" }; menuitem.Click += new EventHandler(CreateEditEvent_Click); return menuitem; }
private static DXMenuItem CreateLoadNurtureEvent() { var menuitem = new DXMenuItem { Caption = "Load Nurture Event" }; menuitem.Click += new EventHandler(CreateLoadNurtureEvent_Click); return menuitem; }
private void DXCreateLayoutMenuItems() { var ribeNewStateName = new RepositoryItemButtonEdit { AutoHeight = false, NullText = @"Введите имя" }; ribeNewStateName.Buttons.Clear(); ribeNewStateName.Buttons.Add(new EditorButton(ButtonPredefines.Glyph) { Image = Resources.save, ToolTip = "Сохранить состояние с введённым именем" }); var dxmeNewLayout = new DXEditMenuItem { Image = Resources.layout_add, Edit = ribeNewStateName, Width = 100 }; var dxdmiNewState = new DXSubMenuItem("Сохранить состояние") { BeginGroup = true, Image = Resources.saveas }; var dxmiDefaultState = new DXMenuItem("Начальное состояние") { Image = Resources.layout_default }; var dxmiLastState = new DXMenuItem("Последнее сохранённое") { Image = Resources.layout_link }; //Создаём обработчики событий для меню menu.BeforePopup += BeforePopupMenuLayout; ribeNewStateName.ButtonClick += NewStateNameButtonClick; bbiDeleteStates.Click += DeleteStatesItemClick; dxmiDefaultState.Click += DefaultStateItemClick; dxmiLastState.Click += LastStateItemClick; //Распределяем кнопки по меню dxdmiNewState.Items.Add(dxmeNewLayout); menu.Items.Add(dxdmiNewState); menu.Items.Add(dxsmiSaved); menu.Items.Add(dxsmiRemove); menu.Items.Add(dxmiDefaultState); menu.Items.Add(dxmiLastState); }
private void m_grv_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e) { GridView view = sender as GridView; // Check whether a row is right-clicked. if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Row) { int rowHandle = e.HitInfo.RowHandle; // Delete existing menu items, if any. e.Menu.Items.Clear(); // Add a submenu with a single menu item. e.Menu.Items.Add(WinFormControls.CreateRowSubMenu(view, rowHandle)); DXMenuItem v_menu_item = new DXMenuItem("&Xem danh sách học viên của lớp môn", new EventHandler(XemNhanVienClick)); e.Menu.Items.Add(v_menu_item); } }