Пример #1
0
 private void gridViewAppointments_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell)
     {
         GridView          currentView       = sender as GridView;
         AgendaAppointment agendaAppointment = currentView.GetRow(e.HitInfo.RowHandle) as AgendaAppointment;
         AgendaViewMenuBuilder.GenerateContextMenu(this, e.Menu, OwnerScheduler, agendaAppointment.SourceAppointment);
     }
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.EmptyRow)
     {
         if (e.Menu == null)
         {
             e.Menu = new DevExpress.XtraGrid.Menu.GridViewMenu(sender as GridView);
         }
         AgendaViewMenuBuilder.GenerateContextMenu(this, e.Menu, OwnerScheduler, null);
     }
 }
Пример #2
0
 private void sub_gridview_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
         if (menu.Column.AbsoluteIndex == 0)
         {
             menu.Items.Clear();
         }
         if (menu.Column.AbsoluteIndex > 2)
         {
             DXMenuItem item = new DXMenuItem("Clear data", onClickClearColumn);
             item.Tag = new MenuColumnInfo(menu.Column);
             menu.Items.Add(item);
         }
     }
 }
Пример #3
0
        private void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            if (e.HitInfo.InRow)
            {
                var p2 = MousePosition;
                popupMenu1.ShowPopup(p2);

                if (ydurum == "Yayından Kaldırıldı")
                {
                    barButtonItem6.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                }
                else
                {
                    barButtonItem6.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                }
            }
        }
Пример #4
0
 private void gridViewMain_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.EmptyRow ||
         e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell
         )
     {
         GridView view = sender as GridView;
         view.FocusedRowHandle = e.HitInfo.RowHandle;
         _gcm = new GridViewCustomMenu(this, view,
                                       e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell ?
                                       PopupMenyType.addRem :
                                       PopupMenyType.justAdd
                                       );
         _gcm.Init(e.HitInfo);
         _gcm.Show(e.Point);
     }
 }
Пример #5
0
        void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            if (e.MenuType != DevExpress.XtraGrid.Views.Grid.GridMenuType.Summary)
            {
                return;
            }

            DevExpress.XtraGrid.Menu.GridViewFooterMenu footerMenu = e.Menu as DevExpress.XtraGrid.Menu.GridViewFooterMenu;
            bool check = e.HitInfo.Column.SummaryItem.SummaryType == DevExpress.Data.SummaryItemType.Custom && Equals("Count", e.HitInfo.Column.SummaryItem.Tag);

            DevExpress.Utils.Menu.DXMenuItem menuItem = new DevExpress.Utils.Menu.DXMenuCheckItem("Active Count", check, null, new EventHandler(MyMenuItem));
            menuItem.Tag = e.HitInfo.Column;
            foreach (DevExpress.Utils.Menu.DXMenuItem item in footerMenu.Items)
            {
                item.Enabled = true;
            }
            footerMenu.Items.Add(menuItem);
        }
      private void vista_datos_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(CreateRowSubMenuGrafico(view, rowHandle));
              // Add a check menu item.
              // DXMenuItem item = CreateMergingEnabledMenuItem(view, rowHandle);
              //   item.BeginGroup = true;
              // e.Menu.Items.Add(item);
          }
      }
Пример #7
0
 private void tableGridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
         //Erasing the default menu items
         //menu.Items.Clear();
         if (menu.Column != null)
         {
             //Adding new items
             if (menu.Column.Caption == "Владелец \"Ежедневник\"")
             {
                 menu.Items.Add(CreateCheckItem("Сортировать по возрастанию", menu.Column, Properties.Resources.Up, new EventHandler(DateAscendingSort)));
                 menu.Items.Add(CreateCheckItem("Сортировать по убыванию", menu.Column, Properties.Resources.Down, new EventHandler(DateDescendingSort)));
             }
         }
     }
 }
Пример #8
0
        // CHI TIET PHIEU XUAT

        private void gvCTPX_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            if (Program.group == "CHINHANH" || Program.group == "USER")
            {
                int maNVLapPX = 0;
                if (gvPX.GetRowCellValue(phieuXuatBindingSource.Position, "MANV") != null)
                {
                    maNVLapPX = int.Parse(gvPX.GetRowCellValue(phieuXuatBindingSource.Position, "MANV").ToString().Trim());
                }
                if (e.MenuType == GridMenuType.Row && maNVLapPX == Program.manv)
                {
                    GridViewMenu menu        = e.Menu;
                    DXMenuItem   menuAddCTPX = createMenuItem("Thêm chi tiết Phiếu Xuất", Properties.Resources.plus);
                    menuAddCTPX.Click += new EventHandler(menuAddCTPX_Click);
                    menu.Items.Add(menuAddCTPX);
                }
            }
        }
Пример #9
0
        private void gridViewObras_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;

                GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

                if (hitInfo.InRow)
                {
                    view.FocusedRowHandle = hitInfo.RowHandle;

                    ContextMenu.Show(view.GridControl, e.Point);
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
 private void BarCodeGridView_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     try
     {
         e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Delete Current Record", (o1, e1) =>
         {
             ProjectFunctions.DeleteCurrentRowOnRightClick(BarCodeGrid, BarCodeGridView);
             dt.AcceptChanges();
             decimal QtySum = 0;
             foreach (DataRow dr in dt.Rows)
             {
                 QtySum = QtySum + Convert.ToDecimal(dr["SFDSCANQTY"]);
             }
             lblTotQty.Text = QtySum.ToString("0");
         }));
     }
     catch (Exception ex)
     {
         ProjectFunctions.SpeakError(ex.Message);
     }
 }
Пример #11
0
        private void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            GridView _grid = gridControl1.FocusedView as GridView;

            if (_grid.FocusedRowHandle == -2147483646 || _grid.FocusedRowHandle == 0)
            {
                _row = usuarioTableAdapter.GetUsuarioDataByID(int.Parse(gridView1.GetRowCellValue(1, "Id").ToString())).FirstOrDefault();
            }
            else
            {
                _row = usuarioTableAdapter.GetUsuarioDataByID(int.Parse(gridView1.GetRowCellValue(_grid.FocusedRowHandle, "Id").ToString())).FirstOrDefault();
            }

            switch (e.MenuType)
            {
            case GridMenuType.Row:
                var menu = e.Menu as GridViewMenu;
                menu.Items.Clear();
                menu.Items.Add(CreateItem("Modificar"));
                break;
            }
        }
Пример #12
0
        private void gridViewArticulos_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            GridView    view    = sender as GridView;
            GridHitInfo hitInfo = view.CalcHitInfo(e.Point);

            if (hitInfo.InRowCell)
            {
                e.Menu.Items.Clear();

                int colId = e.HitInfo.Column.ColumnHandle;
                int rowId = e.HitInfo.RowHandle;
                DevExpress.Utils.Menu.DXMenuItem dxMenuItem;
                if (colNombre.ColumnEdit == null)
                {
                    dxMenuItem = new DevExpress.Utils.Menu.DXMenuItem("Mostrar nombre completo", ComoMostrarDescripcion);
                    e.Menu.Items.Add(dxMenuItem);
                }
                else
                {
                    dxMenuItem = new DevExpress.Utils.Menu.DXMenuItem("Recortar nombre", ComoMostrarDescripcion);
                    e.Menu.Items.Add(dxMenuItem);
                }
            }
        }
Пример #13
0
 private void GridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     MenuPrincipal.ShowPopup(gridControl1.PointToScreen(e.Point));
 }
        private void m_grv_danh_sach_can_phe_duyet_PM_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));
            }
        }
Пример #15
0
 void vw_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
         if (menu != null)
         {
             foreach (DevExpress.Utils.Menu.DXMenuItem item in menu.Items)
             {
                 //禁止显示隐藏列
                 if (item.Caption ==
                     GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnColumnCustomization))
                 {
                     item.Enabled = false;
                 }
                 //禁止GridStringId.MenuColumnGroup=根据此列分组
                 if (item.Caption ==
                     GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnGroup))
                 {
                     item.Enabled = false;
                 }
                 //禁止GridStringId.MenuColumnGroupBox=分组依据框
                 if (item.Caption ==
                     GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnGroupBox))
                 {
                     item.Enabled = false;
                 }
                 //禁止GridStringId.MenuColumnRemoveColumn=移除列
                 if (item.Caption ==
                     GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnRemoveColumn))
                 {
                     item.Enabled = false;
                 }
                 //禁止Show Group By Box
                 if (0 == string.Compare(
                         item.Caption,
                         GridLocalizer.Active.GetLocalizedString(GridStringId.MenuGroupPanelShow), true
                         ))
                 {
                     item.Visible = item.Enabled = false;
                 }
                 //Show Auto Filter Row
                 if (0 == string.Compare(item.Caption,
                                         GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnAutoFilterRowShow), true))
                 {
                     item.Caption = "显示查询行";
                 }
                 if (0 == string.Compare(item.Caption,
                                         GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnAutoFilterRowHide), true))
                 {
                     item.Caption = "隐藏查询行";
                 }
                 //禁止Show Find Panel
                 if (0 == string.Compare(item.Caption,
                                         GridLocalizer.Active.GetLocalizedString(GridStringId.MenuColumnFindFilterShow), true))
                 {
                     item.Visible = item.Enabled = false;
                 }
             }
         }
     }
 }
        private void MasterGridView_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            try
            {
                e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Select Report Data Range", (o1, e1) =>
                {
                    Controls.Add(_RangeSelector);
                    _RangeSelector.BtnLoad.Click += new EventHandler(BtnLoad_Click);
                    _RangeSelector.BringToFront();
                    _RangeSelector.Location = new Point(e.Point.X + 20, e.Point.Y + 20);
                    _RangeSelector.Show();
                    _RangeSelector.DtFrom.Focus();
                }));



                var formatRulesMenu = new DXPopupMenu();
                var view            = sender as GridView;

                DXMenuItem Copy;


                DXMenuItem SAR;



                DXMenuItem Collapse;
                DXMenuItem Expand;
                DXMenuItem FixLeft;
                DXMenuItem FixRight;
                DXMenuItem UnFix;


                Copy = new DXMenuItem("Copy", (o1, e1) =>
                {
                    view.OptionsSelection.MultiSelect = true;
                    view.CopyToClipboard();
                });
                SAR = new DXMenuItem("Select All Records", (o1, e1) =>
                {
                    view.OptionsSelection.MultiSelect = true;
                    view.SelectAll();
                });
                Expand = new DXMenuItem("Expand All", (o1, e1) =>
                {
                    MasterGridView.ExpandAllGroups();
                });
                Collapse = new DXMenuItem("Collapse All", (o1, e1) =>
                {
                    MasterGridView.CollapseAllGroups();
                });
                FixLeft = new DXMenuItem("Fix Column Left", (o1, e1) =>
                {
                    MasterGridView.OptionsView.ColumnAutoWidth = false;
                    var hitInfo = MasterGridView.CalcHitInfo(MasterGrid.PointToClient(Control.MousePosition));
                    if (hitInfo.InRowCell)
                    {
                        int rowHandle = hitInfo.RowHandle;
                        DevExpress.XtraGrid.Columns.GridColumn column = new DevExpress.XtraGrid.Columns.GridColumn();
                        column       = hitInfo.Column;
                        column.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;
                    }
                });
                FixRight = new DXMenuItem("Fix Column Right", (o1, e1) =>
                {
                    MasterGridView.OptionsView.ColumnAutoWidth = false;
                    var hitInfo = MasterGridView.CalcHitInfo(MasterGrid.PointToClient(Control.MousePosition));
                    if (hitInfo.InRowCell)
                    {
                        int rowHandle = hitInfo.RowHandle;
                        DevExpress.XtraGrid.Columns.GridColumn column = new DevExpress.XtraGrid.Columns.GridColumn();
                        column       = hitInfo.Column;
                        column.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Right;
                    }
                });
                UnFix = new DXMenuItem("Unfix Column", (o1, e1) =>
                {
                    MasterGridView.OptionsView.ColumnAutoWidth = false;
                    var hitInfo = MasterGridView.CalcHitInfo(MasterGrid.PointToClient(Control.MousePosition));
                    if (hitInfo.InRowCell)
                    {
                        int rowHandle = hitInfo.RowHandle;
                        DevExpress.XtraGrid.Columns.GridColumn column = new DevExpress.XtraGrid.Columns.GridColumn();
                        column       = hitInfo.Column;
                        column.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.None;
                    }
                });
                e.Menu.Items.Add(Copy);
                e.Menu.Items.Add(SAR);
                e.Menu.Items.Add(Collapse);
                e.Menu.Items.Add(Expand);
                e.Menu.Items.Add(FixLeft);
                e.Menu.Items.Add(FixRight);
                e.Menu.Items.Add(UnFix);
            }

            catch (Exception ex)

            {
                ProjectFunctions.SpeakError(ex.Message);
            }
        }
Пример #17
0
 private void grdGrid_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     pmMenu.ShowPopup(Cursor.Position);
 }
        private void view_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            if (e.HitInfo.InRow && e.HitInfo.InDataRow && e.MenuType == GridMenuType.Row)
            {
                e.Menu.Items.Clear();
                var deleteItem = new DXMenuItem("Убрать", (o, args) =>
                {
                    var view = (GridView)sender;
                    var row = e.HitInfo.RowHandle;

                    if (view.Name == this.gridViewSummary.Name)
                    {
                        var model = (QueryEduSummaryModel) view.GetRow(row);
                        if (model == _querySummaryModelCollection.Current)
                        {
                            this.gridViewEdu.ClearSelection();
                            this.queryControl.UnselectAll();
                        }
                    }
                    else
                    {
                        var model = (QueryEduSummaryModel) view.SourceRow;
                        if (model == _querySummaryModelCollection.Current)
                        {
                            if (view.Name == this.gridViewSummaryEdu.Name)
                            {
                                var edu = (edu) view.GetRow(row);

                                var datasourceIndex = this.eduBindingSource.IndexOf(edu);
                                var eduRow = this.gridViewEdu.GetRowHandle(datasourceIndex);
                                this.gridViewEdu.UnselectRow(eduRow);
                            }
                            else if (view.Name == this.gridViewSummaryQuery.Name)
                            {
                                var query = (query) view.GetRow(row);
                                this.queryControl.UnselectItem(query);
                            }
                        }
                    }
                    view.DeleteRow(row);
                });
                e.Menu.Items.Add(deleteItem);
            }
            else
            {
                e.Allow = false;
            }
        }