private void gridViewShowGridMenu(object sender, PopupMenuShowingEventArgs e)
        {
            try
            {
                m_popupMenu.ItemLinks.Clear();
                GridView view = sender as GridView;
                GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

                m_popupMenu.ItemLinks.Add(m_barButtonsMap[GUIConstants.BarButtonAddNewTaskCaption]);
                if (hitInfo.InRowCell)
                {
                    view.FocusedRowHandle = hitInfo.RowHandle;
                    m_currentNode = m_tableGridCaseAdapter.DataSourceList[view.FocusedRowHandle];
                    m_popupMenu.ItemLinks.Add(m_barButtonsMap[GUIConstants.BarButtonDeleteNodeCaption]);
                }
                else
                {
                    m_currentNode = m_tableGridCaseAdapter.GetDataSourceListParent();
                }
                m_popupMenu.ShowPopup(m_barManager, view.GridControl.PointToScreen(e.Point));
            }
            catch (System.Exception ex)
            {
                Log.Logger.WriteErrorMessage(string.Format("Can't build TableGridPopupMenu, exception:\n\t{0}", ex.ToString()));
            }
        }
 protected void ASPxScheduler1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     {
         e.Menu.Items.Clear();
         e.Menu.Visible = false;
     }
 }
 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);
 }
 void SchedulerControlOnPopupMenuShowing(object sender, PopupMenuShowingEventArgs popupMenuShowingEventArgs) {
     var popupMenus = ((IModelListViewOptionsScheduler)View.Model).OptionsScheduler.PopupMenus;
     var schedulerMenuItemIds = popupMenus.Select(popupMenu => new { ModelMenu = popupMenu, MenuId = (SchedulerMenuItemId)Enum.Parse(typeof(SchedulerMenuItemId), popupMenu.MenuId) });
     var menus = schedulerMenuItemIds.Select(arg => new { arg.ModelMenu, Menu = popupMenuShowingEventArgs.Menu.GetPopupMenuById(arg.MenuId) });
     foreach (var popupMenu in menus) {
         new SchedulerPopupMenuModelSynchronizer(popupMenu.Menu, popupMenu.ModelMenu).ApplyModel();
     }
 }
        void gridViewPanel1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            GridView gv = sender as GridView;

            hi = gv.CalcHitInfo(e.Point);
            if (hi.InRow)
            {
                sourceIndex = gv.GetDataSourceRowIndex(hi.RowHandle);
                fixedRowRemoveMenu.Show(gv.GridControl, e.Point);
            }
        }
Exemple #6
0
        private void GridPopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            var col = e.HitInfo.Column;

            if (col == null)
            {
                return;
            }

            if (e.MenuType == GridMenuType.Column)
            {
                string[] columns =
                {
                    GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnGroup),
                    GridLocalizer.Active.GetLocalizedString(GridStringId.MenuGroupPanelShow)
                };

                foreach (DXMenuItem item in e.Menu.Items)
                {
                    if (columns.Contains(item.Caption))
                    {
                        item.Visible = false;
                    }
                }

                if (col.Caption == Resources.Selection || col.Caption == Resources.Progress)
                {
                    return;
                }

                string colName = (col.Fixed == FixedStyle.None) ? "Freeze Column" : "Unfreeze Column";
                e.Menu.Items.Add(new DXMenuItem(colName, ChangeFixedColumnStyle)
                {
                    Tag = col.FieldName
                });
            }
            else if (e.MenuType == GridMenuType.Row)
            {
                if (col.Caption == Resources.Selection || col.Caption == Resources.Progress)
                {
                    return;
                }

                e.Menu.Items.Add(new DXMenuItem("Change Fix Action", ChangeFixAction, imageCollection.Images[7]));
                e.Menu.Items.Add(new DXMenuItem("Copy Value", CopyCellValue, imageCollection.Images[4])
                {
                    Tag = col.FieldName
                });
                e.Menu.Items.Add(new DXMenuItem("Filter Value", FilterCellValue, imageCollection.Images[5])
                {
                    Tag = col.FieldName
                });
            }
        }
        private void showPopupMenu(PopupMenuShowingEventArgs e)
        {
            if (!shouldShowPopupMenu(e))
            {
                return;
            }

            var popupMenu = new DataBrowserPopupMenu(_gridViewBinder, _presenter, e.HitInfo.RowHandle);

            popupMenu.Show(e.HitInfo.HitPoint);
        }
 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);
         }
     }
 }
        private void gvChiTietHoaDon_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.MenuType == GridMenuType.Row)
            {
                hangctDangChon = e.HitInfo.RowHandle;
                e.Menu.Items.Clear();

                DXMenuItem menu = new DXMenuItem("Xóa phụ tùng đã chọn", new EventHandler(XoaPTDangChon));
                e.Menu.Items.Add(menu);
            }
        }
Exemple #10
0
        private void m_grv_ds_don_dat_hang_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Row)
            {
                int rowHandle = e.HitInfo.RowHandle;
                e.Menu.Items.Clear();
                e.Menu.Items.Add(WinFormControls.CreateRowSubMenu(view, rowHandle));
            }
        }
Exemple #11
0
        private void gridViewPembelian_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            GridView    view    = (GridView)sender;
            GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

            if (hitInfo.InRow)
            {
                view.FocusedRowHandle = hitInfo.RowHandle;
                contextMenuStrip1.Show(view.GridControl, e.Point);
            }
        }
Exemple #12
0
 private void OnGridViewPopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (!e.HitInfo.InRowCell)
     {
         return;
     }
     foreach (var menuItem in GetContextMenuItems(advBandedGridView, e.HitInfo.RowHandle))
     {
         e.Menu.Items.Add(menuItem);
     }
 }
        void gvGuestBook_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            GridView    view    = (GridView)sender;
            GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

            if (hitInfo.InRow)
            {
                view.FocusedRowHandle = hitInfo.RowHandle;
                cmsEditor.Show(view.GridControl, e.Point);
            }
        }
 private void TreeList_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     //if (e.Menu is TreeListNodeMenu)
     //{
     //	treeList.FocusedNode = ((TreeListNodeMenu)e.Menu).Node;
     //	e.Menu.Items.Add(new DXMenuItem("Expand all", (sndr, args) => treeList.ExpandAll(), treeListPopUpMenuImageCollection.Images[0]));
     //	e.Menu.Items.Add(new DXMenuItem("Collapse all", (sndr, args) => treeList.CollapseAll(), treeListPopUpMenuImageCollection.Images[1]));
     //	//open
     //	//print
     //}
 }
Exemple #15
0
 private void GridView_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
     {
         DevExpress.XtraGrid.Menu.GridViewColumnMenu menu = e.Menu as DevExpress.XtraGrid.Menu.GridViewColumnMenu;
         menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Customize", new EventHandler((menusender, menue) => { LayoutControlGrid.ShowCustomizationForm(); }), CDS.Client.Desktop.Essential.Properties.Resources.layout_16)
         {
             BeginGroup = true
         });
     }
 }
        void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.HitInfo.Column != gcol_BackColor && e.HitInfo.Column != gcol_FontColor)
            {
                return;
            }

            DXMenuItem copyitem = new DXMenuItem("设置默认颜色", new EventHandler(DoSetDefaultColor), null);

            e.Menu.Items.Add(copyitem);
        }
Exemple #17
0
        private void TreeListObjectExplorerOnPopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            var focusedNodeType = treeListObjExp.FocusedNode?.GetValue(treeListColumnType).ToString();

            if (focusedNodeType == null)
            {
                return;
            }
            var popUpMenuAction = _popupActionDictionary[focusedNodeType];

            popUpMenuAction.Invoke();
        }
 void treeList_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.Menu.MenuType == XtraTreeList.Menu.TreeListMenuType.Node)
     {
         var hi     = TreeList.CalcHitInfo(e.Point);
         var helper = new FilterTreeListHelper <TEntity, TID, TUnitOfWork>(TreeList);
         if (!helper.PopulateFiltersMenu(e.Menu, hi.Node, ViewModel))
         {
             e.Allow = false;
         }
     }
 }
Exemple #19
0
        protected void ASPxScheduler1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            ASPxSchedulerPopupMenu menu = e.Menu;

            if (menu.MenuId.Equals(SchedulerMenuItemId.DefaultMenu))
            {
                DevExpress.Web.MenuItem defaultSubMenu = menu.Items.FindByName("SwitchViewMenu");
                DevExpress.Web.MenuItem subMenuItem    = new DevExpress.Web.MenuItem("Agenda View", "AgendaView");
                defaultSubMenu.Items.Add(subMenuItem);
                menu.ClientSideEvents.ItemClick = "DefaultViewMenuHandler";
            }
        }
Exemple #20
0
 private void tableGridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
         if (menu.Column == null)
         {
             menu.Items.Add(CreateCheckItem("Добавить недостающие записи Пинг-серверов", menu.Column, null, AddPingServers));
             menu.Items.Add(CreateCheckItem("Изменение всех значений...", menu.Column, null, ItemsEdit));
         }
     }
 }
        void gridViewPanel2_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            GridView gv = sender as GridView;

            hi = gv.CalcHitInfo(e.Point);
            if (hi.InRow)
            {
                sourceIndex = gv.GetDataSourceRowIndex(hi.RowHandle);
                rowHeight   = listOfRowsHeights[sourceIndex];
                fixedRowAddMenu.Show(gv.GridControl, e.Point);
            }
        }
 static void TreePopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.Menu.MenuType != TreeListMenuType.Column)
     {
         return;
     }
     foreach (var item in e.Menu.Items.Cast <DXMenuItem>().Where(item => item.Caption == "Column Chooser"))
     {
         item.Enabled = false;
         break;
     }
 }
Exemple #23
0
 private void bandedGridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.HitInfo.InRow)
     {
         GridView view = sender as GridView;
         view.FocusedRowHandle = e.HitInfo.RowHandle;
         foreach (DXMenuItem item in menuItems)
         {
             e.Menu.Items.Add(item);
         }
     }
 }
Exemple #24
0
        void gvSPK_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            GridView    view    = (GridView)sender;
            GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

            if (hitInfo.InRow)
            {
                view.FocusedRowHandle = hitInfo.RowHandle;
                cmsEditor.Show(view.GridControl, e.Point);
                this.SelectedSPK = gvSPK.GetRow(view.FocusedRowHandle) as SPKViewModel;
            }
        }
Exemple #25
0
        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;
                itemChangeViewTo.Caption = "&보기방식 변경";

                // Remove unnecessary items.
                e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewAllDayEvent);
                // Disable the "New Recurring Appointment" menu item.
                e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringAppointment);
                e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringEvent);
                e.Menu.RemoveMenuItem(SchedulerMenuItemId.SwitchToGroupByResource);

                // Find the "New Appointment" menu item and rename it.
                SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment);
                if (item != null)
                {
                    item.Caption = "&일정추가";
                    // item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg");
                }
                SchedulerMenuItem item2 = e.Menu.GetMenuItemById(SchedulerMenuItemId.GotoDate);
                if (item2 != null)
                {
                    item2.Caption = "&설정날짜이동";
                    // item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg");
                }
                SchedulerMenuItem item3 = e.Menu.GetMenuItemById(SchedulerMenuItemId.GotoThisDay);
                if (item3 != null)
                {
                    item3.Caption = "&선택된날짜이동";
                }
                SchedulerMenuItem item4 = e.Menu.GetMenuItemById(SchedulerMenuItemId.GotoToday);
                if (item4 != null)
                {
                    item4.Caption = "&오늘날짜이동";
                }

                // 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("저장", MyClickHandler));
            }
        }
Exemple #26
0
    protected void ASPxScheduler1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
    {
        ASPxSchedulerPopupMenu menu = e.Menu;

        if (menu.MenuId.Equals(SchedulerMenuItemId.DefaultMenu))
        {
            menu.ClientSideEvents.ItemClick = String.Format("function(s, e) {{ DefaultViewMenuHandler({0}, s, e); }}", ASPxScheduler1.ClientInstanceName);
            MenuItemCollection menuItems   = menu.Items;
            MenuItem           defaultItem = menuItems.FindByName("NewAppointment");
            defaultItem.Name = "MyNewAppointment";
            defaultItem.Text = "Instant Appointment";
        }
    }
Exemple #27
0
        private void HelpGridView_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Select All Records", (o1, e1) =>
            {
#pragma warning disable CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.'
                var MaxRow = ((HelpGrid.KeyboardFocusView as GridView).RowCount);
#pragma warning restore CS0618 // 'GridControl.KeyboardFocusView' is obsolete: 'Use the FocusedView property instead.'
                for (var i = 0; i < MaxRow; i++)
                {
                    HelpGridView.SetRowCellValue(i, HelpGridView.Columns["Select"], true);
                }
            }));
        }
Exemple #28
0
 private void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == GridMenuType.Row)
     {
         if (_gridMenu != null && _gridMenu.Count > 0)
         {
             _gridMenu.ForEach(menu =>
             {
                 e.Menu.Items.Add(menu);
             });
         }
     }
 }
 private void tableGridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
         if (menu.Column == null)
         {
             menu.Items.Add(CreateCheckItem("Заполнить остальные поля", menu.Column, null, FillEmptyField));
             menu.Items.Add(CreateCheckItem("Найти совпадения адресов", menu.Column, null, FindEqualAddresses));
             menu.Items.Add(CreateCheckItem("Сгенерировать IP-адреса", menu.Column, null, GenerateIPAddress));
         }
     }
 }
 //===========================Khu vực Xử Lý Phiếu Nhập===========================
 private void gvDatHangByPN_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (Program.group == "CHINHANH" || Program.group == "USER")
     {
         if (datHangBDS.Count != 0)
         {
             GridViewMenu menu      = e.Menu;
             DXMenuItem   menuAddPN = createMenuItem("Thêm Phiếu Nhập", Properties.Resources.add_16);
             menuAddPN.Click += new EventHandler(menuAddPN_Click);
             menu.Items.Add(menuAddPN);
         }
     }
 }
Exemple #31
0
        private static DXMenuItem NewDXMenuItem(object sender, PopupMenuShowingEventArgs e, IModelGridViewRuleCustomSummaryCalculate modelGridViewRule)
        {
            bool       check    = e.HitInfo.Column.SummaryItem.SummaryType == SummaryItemType.Custom && Equals(modelGridViewRule, e.HitInfo.Column.SummaryItem.Tag);
            DXMenuItem menuItem = new DXMenuCheckItem(modelGridViewRule.Caption, check, null, (o, args) => {
                var item            = ((DXMenuItem)sender);
                var col             = ((GridColumn)item.Tag);
                col.SummaryItem.Tag = modelGridViewRule;
                col.SummaryItem.SetSummary(SummaryItemType.Custom, string.Empty);
            });

            menuItem.Tag = e.HitInfo.Column;
            return(menuItem);
        }
Exemple #32
0
        private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.Menu.Id == SchedulerMenuItemId.DefaultMenu)
            {
                SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment);

                if (item != null)
                {
                    // Rename the menu item for the 'New Appointment' action.
                    item.Caption = "Crear editar turnos";
                }
            }
        }
 private void m_grv_ds_don_hang_dang_xu_ly_PopupMenuShowing(object sender, 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));
     }
 }
Exemple #34
0
        private void treeList_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            tlTemp = sender as TreeList;

            if (e.Menu is TreeListNodeMenu)
            {
                tlTemp.FocusedNode = ((TreeListNodeMenu)e.Menu).Node;
                //e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Edit", bbEdit_ItemClick));
                //e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Add child", bbAddChild_ItemClick));
                e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Delete", bbDelete_ItemClick));
                e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Cancle", bbCancle_ItemClick));
            }
        }
Exemple #35
0
        private void gridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            selectedID = Convert.ToInt32((sender as GridView).GetFocusedRowCellValue("Id").ToString());
            GridView    view    = sender as GridView;
            GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

            if (hitInfo.InRowCell)
            {
                view.FocusedRowHandle = rowHandle = hitInfo.RowHandle;
                column = hitInfo.Column;
                popupMenu1.ShowPopup(barManager1, view.GridControl.PointToScreen(e.Point));
            }
        }
 //=======================Khu vực Xử Lý Chi Tiết Đơn Đặt Hàng====================
 private void gvCTDDH_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (Program.group == "CHINHANH" || Program.group == "USER")
     {
         if (e.MenuType == GridMenuType.Row && kiemTraCTDDHCuaNV())
         {
             GridViewMenu menu = e.Menu;
             DXMenuItem   menuAddChiTietDDH = createMenuItem("Thêm chi tiết ĐĐH", Properties.Resources.add_16);
             menuAddChiTietDDH.Click += new EventHandler(menuAddChiTietDDH_Click);
             menu.Items.Add(menuAddChiTietDDH);
         }
     }
 }
        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);
            }
        }
Exemple #38
0
        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);
                }

                if(pItems != null)
                    if (pItems.RefreshGrid)
                        e.Menu.Items.Add(CreateRefreshMenu(view, rowHandle));

                e.Menu.CloseUp += Menu_CloseUp;
            }
        }
        private void grwUnitList_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")
                {
                    Image = ImgCollection.Images["refresh2_16x16.png"],
                    Shortcut = Shortcut.F5
                };
                itemReload.Click += itemReload_Click;
                menu.Items.Add(itemReload);

                var itemAdd = new DXMenuItem("Thêm")
                {
                    BeginGroup = true,
                    Image = ImgCollection.Images["new_16x16.png"],
                    Shortcut = Shortcut.CtrlN
                };
                itemAdd.Click += itemAdd_Click;
                menu.Items.Add(itemAdd);

                var itemEdit = new DXMenuItem("Sửa")
                {
                    Image = ImgCollection.Images["edit_16x16.png"],
                    Shortcut = Shortcut.CtrlE
                };
                itemEdit.Click += itemEdit_Click;
                menu.Items.Add(itemEdit);

                var itemDelete = new DXMenuItem("Xóa")
                {
                    Image = ImgCollection.Images["delete_16x16.png"],
                    Shortcut = Shortcut.CtrlDel
                };
                itemDelete.Click += itemDelete_Click;
                menu.Items.Add(itemDelete);
            }
        }
Exemple #40
0
 protected void schSchedule_OnPopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     ASPxSchedulerPopupMenu menu = e.Menu;
     menu.Items.Clear();
     menu.ClientSideEvents.ItemClick =
         String.Format("function(s, e) {{ DefaultAppointmentMenuHandler({0}, s, e.item.name); }}",
             schSchedule.ClientID);
     if (menu.Id.Equals(SchedulerMenuItemId.DefaultMenu))
     {
         menu.Items.Add(new DevExpress.Web.MenuItem("Створити", "NewEvent"));
     }
     else
     {
         if (menu.Id.Equals(SchedulerMenuItemId.AppointmentMenu))
         {
             menu.Items.Add(new DevExpress.Web.MenuItem("Редагувати", "EditOneEvent"));
             menu.Items.Add(new DevExpress.Web.MenuItem("Видалити", "DeleteOneEvent"));
         }
     }
 }
Exemple #41
0
 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;
     }
 }
Exemple #42
0
 private void gviewRight_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     this.lastFocusedGrid = this.gviewRight;
       this.UpdateMenu();
       if (e.MenuType == GridMenuType.Row)
     this.popupContext.ShowPopup(this.gridRight.PointToScreen(e.Point));
 }
        private void spreadsheetTemplate_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.MenuType == SpreadsheetMenuType.Cell)
            {
                e.Menu.Items.Clear();
                var ranges = this.spreadsheetTemplate.GetSelectedRanges();
                var itemAddLeft         = new SpreadsheetMenuItem("Добавить cлева", (o, args) => this.formulaEditControl1.AddToLeftPart(ranges));
                var itemReplaceLeft     = new SpreadsheetMenuItem("Заменить слева", (o, args) => this.formulaEditControl1.ReplaceLeftPart(ranges));
                var itemAddRight        = new SpreadsheetMenuItem("Добавить справа", (o, args) => this.formulaEditControl1.AddToRightPart(ranges));
                var itemReplaceRight    = new SpreadsheetMenuItem("Заменить справа", (o, args) => this.formulaEditControl1.ReplaceRightPart(ranges));

                itemAddLeft.BeginGroup = true;
                e.Menu.Items.Add(itemAddLeft);
                e.Menu.Items.Add(itemReplaceLeft);
                itemAddRight.BeginGroup = true;
                e.Menu.Items.Add(itemAddRight);
                e.Menu.Items.Add(itemReplaceRight);
            }
        }
Exemple #44
0
 private void gvImportFileDataContact_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     GridUtility.CreateGridContextMenu(view, e);
 }
        private void bandedGridView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.HitInfo.InRow)
            {
                GridView view = sender as GridView;
                view.FocusedRowHandle = e.HitInfo.RowHandle;
                foreach (DXMenuItem item in menuItems)
                    e.Menu.Items.Add(item);
            }

        }
Exemple #46
0
 private void gridViewResourceSchedules_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     GridUtility.CreateGridContextMenu(view, e);
 }
        /// <summary>
        /// Handles the PopupMenuShowing event of the grdViewByTitle control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs"/> instance containing the event data.</param>
        private void grdViewByTitle_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            var view = sender as GridView;

            e.Allow = false;

            this.popupMovieList.ShowPopup(this.barManager1, view.GridControl.PointToScreen(e.Point));
        }
 void gvSPKSales_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = (GridView)sender;
     GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
     if (hitInfo.InRow)
     {
         view.FocusedRowHandle = hitInfo.RowHandle;
         cmsEditor.Show(view.GridControl, e.Point);
     }
 }
Exemple #49
0
 private void CustomMenuPopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     switch (e.Menu.MenuType)
     {
         case TreeListMenuType.Column:
             HideCustomizationColumns(e.Menu);
             CreateSelectLayoutSubmenu(e.Menu);
             break;
         case TreeListMenuType.Node:
             if (CustomPopupMenu == null)
             {
                 e.Menu.Items.Add(new DXMenuItem("Развернуть всё", ExpandAllItemClick, Resources.expand));
                 e.Menu.Items.Add(new DXMenuItem("Свернуть все ветки", CollapseAllItemClick, Resources.collapse));
             }
             else
             {
                 if (bbiExpandAll.Links.Count == 0)
                     CustomPopupMenu.ItemLinks.Add(bbiExpandAll);
                 if (bbiCollapseAll.Links.Count == 0)
                     CustomPopupMenu.ItemLinks.Add(bbiCollapseAll);
                 ShowPopupMenu(e);
             }
             break;
     }
 }
 void SchedulerControlOnPopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
     SynchMenu(e.Menu);
 }
Exemple #51
0
 static void TreePopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     if (e.Menu.MenuType != TreeListMenuType.Column)
     {
         return;
     }
     foreach (var item in e.Menu.Items.Cast<DXMenuItem>().Where(item => item.Caption == "Column Chooser"))
     {
         item.Enabled = false;
         break;
     }
 }
Exemple #52
0
 private void gvSubCampaign_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     GridUtility.CreateGridContextMenu(view, e);
 }
Exemple #53
0
 /// <summary>
 /// Показать контекстное меню в точке клика правого клика мыши
 /// </summary>
 private void ShowPopupMenu(PopupMenuShowingEventArgs e)
 {
     var hitInfo = CalcHitInfo(e.Point);
     if (hitInfo.Node == null)
     {
         return;
     }
     CustomPopupMenu.ShowPopup(PointToScreen(e.Point));
 }
 private void m_grv_ds_don_dat_hang_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Row)
     {
         int rowHandle = e.HitInfo.RowHandle;
         e.Menu.Items.Clear();
         e.Menu.Items.Add(WinFormControls.CreateRowSubMenu(view, rowHandle));
     }
 }
Exemple #55
0
 private void gridViewAnswerForm_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     GridUtility.CreateGridContextMenu(view, e);
 }
Exemple #56
0
 private void gviewLeft_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     this.lastFocusedGrid = this.gviewLeft;
       this.UpdateMenu();
       if (e.MenuType == GridMenuType.Row && e.HitInfo.InRow && this.gviewLeft.IsDataRow(e.HitInfo.RowHandle))
     this.popupContext.ShowPopup(this.gridLeft.PointToScreen(e.Point));
 }
Exemple #57
0
 private void gvCustomerUser_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     GridUtility.CreateGridContextMenu(view, e);
 }
 private void scheControl_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     e.Menu.Items.Clear();
 }
Exemple #59
0
        private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.Menu.Id == SchedulerMenuItemId.DefaultMenu)
            {
                SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment);

                if (item != null)
                    // Rename the menu item for the 'New Appointment' action. 
                    item.Caption = "Crear editar turnos";
            }
        }
Exemple #60
0
 private void gvExportTemplate_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
 {
     GridView view = sender as GridView;
     GridUtility.CreateGridContextMenu(view, e);
 }