void TableView_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.GroupBox
         });
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.SortAscending
         });
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.SortDescending
         });
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.ClearSorting
         });
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.GroupColumn
         });
     }
 }
示例#2
0
        private void grv_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            if (e.MenuType != DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
            {
                return;
            }
            try
            {
                DevExpress.XtraGrid.Menu.GridViewMenu headerMenu = (DevExpress.XtraGrid.Menu.GridViewMenu)e.Menu;
                if (headerMenu.Items.Count > 11)
                {
                    return;
                }

                DevExpress.Utils.Menu.DXMenuItem menuItem      = new DevExpress.Utils.Menu.DXMenuItem("Reset Layout Grid", new EventHandler(MyMenuItem));
                DevExpress.Utils.Menu.DXMenuItem menuSave      = new DevExpress.Utils.Menu.DXMenuItem("Save Layout Grid", new EventHandler(MenuSave));
                DevExpress.Utils.Menu.DXMenuItem menuItemClear = new DevExpress.Utils.Menu.DXMenuItem("Clear Layout Grid", new EventHandler(MenuClear));
                menuItem.BeginGroup = true;
                menuItem.Tag        = e.Menu;
                menuItem.BeginGroup = true;
                menuItemClear.Tag   = e.Menu;
                menuSave.Tag        = e.Menu;

                headerMenu.Items.Add(menuItem);
                headerMenu.Items.Add(menuItemClear);
                headerMenu.Items.Add(menuSave);
            }
            catch
            {
            }
        }
        /// <summary>
        /// Show grid menu event handler
        /// </summary>
        /// <param name="sender">The sender object</param>
        /// <param name="e">Event arguments</param>
        private void ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            if (e.MenuType != GridMenuType.Column)
            {
                return;
            }

            // Remove the Column Chooser menu item.
            e.Customizations.Add(new RemoveBarItemAndLinkAction()
            {
                ItemName = DefaultColumnMenuItemNames.ColumnChooser
            });

            // Create a custom menu item and add it to the context menu.
            var barButtonItem = new BarButtonItem();

            barButtonItem.Name             = "toggleHighlight";
            barButtonItem.Content          = "Toggle Highlight";
            barButtonItem.Command          = this.Command;
            barButtonItem.CommandParameter = e.MenuInfo.Column;

            barButtonItem.Glyph = DXImageHelper.GetImageSource(@"Images/Conditional Formatting/HighlightCellsRules_16x16.png");

            barButtonItem.SetValue(BarItemLinkActionBase.ItemLinkIndexProperty, 0);

            e.Customizations.Add(barButtonItem);
        }
        private void gvMain_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            var gridColumn = e.HitInfo.Column;

            e.Allow = false;
            if (gridColumn != null && e.HitInfo.InRowCell)
            {
                switch (gridColumn.SortOrder)
                {
                case ColumnSortOrder.Ascending:
                    btnAscending.Enabled  = false;
                    btnDescending.Enabled = true;
                    btnNoSort.Enabled     = true;
                    break;

                case ColumnSortOrder.Descending:
                    btnAscending.Enabled  = true;
                    btnDescending.Enabled = false;
                    btnNoSort.Enabled     = true;
                    break;

                default:
                    btnAscending.Enabled  = true;
                    btnDescending.Enabled = true;
                    btnNoSort.Enabled     = false;
                    break;
                }

                mnuSort.Tag = gridColumn;
                e.Allow     = true;
            }
        }
        private void OnShowGridMenu(object sender, GridMenuEventArgs e)
        {
            if (_miShowAutoFilter == null || UseStandardGridMenu)
            {
                return;
            }

            var view = sender as TreeListView;

            if (view == null)
            {
                return;
            }

            // отключаем контекстное меню для Autofilter
            if (e.MenuType == GridMenuType.RowCell)
            {
                var hi = view.CalcHitInfo((DependencyObject)e.TargetElement);
                if (hi.RowHandle == AutoFilterRowHandle)
                {
                    e.Handled = true;
                }
            }

            _miShowAutoFilter.Content = view.ShowAutoFilterRow
                ? StringResources.HideAutoFilterMenuItemContent
                : StringResources.ShowAutoFilterMenuItemContent;

            _miShowTotalSummary.Content = view.ShowTotalSummary
                ? StringResources.HideTotalSummaryContent
                : StringResources.ShowTotalSummaryContent;
        }
示例#6
0
        //public virtual void excel_Click(object sender, EventArgs e)
        //{
        //    SaveFileDialog sfd = new SaveFileDialog();
        //    sfd.Filter = App.ExcelDialogFilter;
        //    if (sfd.ShowDialog() == DialogResult.OK)
        //    {
        //        this.ExportToXls(sfd.FileName);
        //        Process.Start(sfd.FileName);
        //    }
        //}
        void gridView_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            GridView gr = (GridView)sender;

            if (e.Menu == null)
            {
                return;
            }
            if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.ColumnPanel ||
                e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.ColumnEdge ||
                e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.ColumnFilterButton ||
                e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.Column)
            {
                bool isExcel = false;
                foreach (DevExpress.Utils.Menu.DXMenuItem item in e.Menu.Items)
                {
                    if (item.Tag.ToString() == "ExportExcel")
                    {
                        isExcel = true;
                        continue;
                    }
                }
                AddMenu(gr, e.Menu, isExcel);
            }
        }
示例#7
0
        private void AssociatedObject_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            if (e.MenuType == GridMenuType.Column)
            {
                e.Customizations.Add(new BarItemLinkSeparator());
                e.Customizations.Add(new BarButtonItem
                {
                    Content = Properties.Resources.AddCustomColumn,
                    Glyph   = AddCustomColumnItemGlyph,
                    Command = new DelegateCommand(() =>
                    {
                        GridColumn gridColumn = new GridColumn
                        {
                            Header      = Properties.Resources.CustomColumn,
                            FieldName   = Guid.NewGuid().ToString(),
                            UnboundType = UnboundColumnType.String,
                            AllowUnboundExpressionEditor = true
                        };
                        AssociatedObject.Grid.Columns.Add(gridColumn);

                        CustomColumnView customColumnView = new CustomColumnView
                        {
                            DataContext = gridColumn,
                            Owner       = Window.GetWindow(AssociatedObject)
                        };
                        customColumnView.ShowDialog();
                    })
                });

                if (e.MenuInfo.Column != null && e.MenuInfo.Column.AllowUnboundExpressionEditor == true)
                {
                    e.Customizations.Add(new BarButtonItem
                    {
                        Content = Properties.Resources.RemoveCustomColumn,
                        Glyph   = RemoveCustomColumnItemGlyph,
                        Command = new DelegateCommand(() =>
                        {
                            AssociatedObject.Grid.Columns.Remove(e.MenuInfo.Column as GridColumn);
                        })
                    });

                    e.Customizations.Add(new BarButtonItem
                    {
                        Content = Properties.Resources.EditCustomColumn,
                        Glyph   = EditCustomColumnItemGlyph,
                        Command = new DelegateCommand(() =>
                        {
                            CustomColumnView customColumnView = new CustomColumnView
                            {
                                DataContext = e.MenuInfo.Column,
                                Owner       = Window.GetWindow(AssociatedObject)
                            };
                            customColumnView.ShowDialog();
                        })
                    });
                }
            }
        }
示例#8
0
 void gv_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     if (e.HitInfo.InRowCell && e.HitInfo.RowHandle >= 0 &&
         buttonEdit3.Enabled && buttonEdit3.Visible)
     {
         e.Menu.Items.Add(new DXMenuItem("&Hapus Baris",
                                         HapusMenu_Click, Properties.Resources.Delete_Red));
     }
 }
示例#9
0
        void SetContextMenuItemCommand(GridMenuEventArgs e, string itemName, int index)
        {
            BarItem item = e.MenuInfo.Menu.GetBarItemByName(itemName);

            if (item != null)
            {
                item.Command = new DelegateCommand <object>(delegate(object obj) { groupModeList.SelectedIndex = index; });
            }
        }
 private void gridView1_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     GridView view = (GridView)sender;
     GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
     if (hitInfo.InRow)
     {
         view.FocusedRowHandle = hitInfo.RowHandle;
         cmnuAComplementarias.Show(view.GridControl, e.Point);
     }
 }
 void View_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.SortBySummary
         });
     }
 }
示例#12
0
        void GtidXtraGridControl_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            GridView view = sender as GridView;

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

            if (hitInfo.InRow)
            {
                view.FocusedRowHandle = hitInfo.RowHandle;
                ContextMenuStrip.Show(view.GridControl, e.Point);
            }
        }
        private void OnShowGridMenu(object sender, GridMenuEventArgs e)
        {
            if (e.MenuType != GridMenuType.RowCell)
            {
                return;
            }

            if (e.Items == null || e.Items.Count == 0)
            {
                return;
            }

            foreach (var item in e.Items)
            {
                item.IsVisible = false;
            }

            if (!CanEdit())
            {
                return;
            }

            var cells = GetSelectedCells();

            if (cells == null || cells.Count == 0)
            {
                return;
            }

            var columns =
                cells.Where(c => c.Column != null && !string.IsNullOrEmpty(c.Column.FieldName))
                .Select(c => c.Column.FieldName)
                .Distinct()
                .ToArray();

            if (columns.Length != 1 || columns[0] != InputPlPos.InputplpostemanPropertyName)
            {
                return;
            }

            e.Items[1].IsVisible = true;

            object cellvalue;

            if (!ValidateCells(cells, out cellvalue) || cellvalue == null || Equals(cellvalue, string.Empty))
            {
                return;
            }

            e.Items[0].IsVisible = true;
            e.Items[0].Content   = string.Format(StringResources.AutoValueinsertFormat, cellvalue);
        }
示例#14
0
 private void View_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         GridColumnHeader columnHeader          = e.TargetElement as GridColumnHeader;
         GridColumn       column                = columnHeader.DataContext as GridColumn;
         bool             allowEditColumnHeader = GetAllowEditHeader(column);
         BarButtonItem    item = new BarButtonItem();
         item.Content    = allowEditColumnHeader ? "Hide ColumnHeader Editor" : "Show ColumnHeader Editor";
         item.ItemClick += Item_ItemClick;
         item.Tag        = new object[] { column, columnHeader };
         e.Customizations.Add(item);
     }
 }
        /// <summary>
        /// Handles the ShowGridMenu event of the gridView1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see>
        ///                       <cref>GridMenuEventArgs</cref>
        ///                     </see> instance containing the event data.</param>
        private void gridView1_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            var view = sender as GridView;

            if (view != null && e != null)
            {
                GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
                if (hitInfo.InRow)
                {
                    view.FocusedRowHandle = hitInfo.RowHandle;
                    contextMenuStrip2.Show(view.GridControl, e.Point);
                }
            }
        }
示例#16
0
        void OnShowGridMenu(object sender, GridMenuEventArgs e)
        {
            BarItem showColumnChooserBarItem = null;

            foreach (BarItem barItem in e.Items)
            {
                if (barItem.Name == "ItemColumnChooser" || (barItem.Content != null && barItem.Content.ToString() == "Show Column Chooser"))
                {
                    showColumnChooserBarItem = barItem;
                }
            }
            if (showColumnChooserBarItem != null)
            {
                showColumnChooserBarItem.IsVisible = false;
            }
        }
示例#17
0
 void view_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column && e.MenuInfo.Column.FieldName == "OrderDate")
     {
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.MenuColumnGroupIntervalNone
         });
         e.Customizations.Add(new RemoveBarItemAndLinkAction()
         {
             ItemName = DefaultColumnMenuItemNames.MenuColumnGroupIntervalDay
         });
         SetContextMenuItemCommand(e, DefaultColumnMenuItemNames.MenuColumnGroupIntervalMonth, 1);
         SetContextMenuItemCommand(e, DefaultColumnMenuItemNames.MenuColumnGroupIntervalYear, 2);
         SetContextMenuItemCommand(e, DefaultColumnMenuItemNames.MenuColumnGroupIntervalSmart, 3);
     }
 }
        private void TableView_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            // Check whether this event was raised for a column's context menu.
            // If not - exit and leave the menu shown.
            if (e.MenuType != GridMenuType.Column)
            {
                return;
            }

            // Check whether this event was raised for a custom button.
            // If not - exit and hide the menu.
            if ((e.TargetElement as Control).Tag == null)
            {
                e.Handled = true;
                return;
            }
        }
示例#19
0
        private void AssociatedObject_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            BarButtonItem backToDefaultButton = new BarButtonItem {
                Content = Properties.Resources.DefaultView
            };

            backToDefaultButton.ItemClick += (x, y) =>
            {
                try
                {
                    DefaultLayout.Position = 0;
                    AssociatedObject.DataControl.RestoreLayoutFromStream(DefaultLayout);
                }
                catch { return; }
            };

            e.Customizations.Add(new BarItemSeparator());
            e.Customizations.Add(backToDefaultButton);
        }
示例#20
0
        private void TableView_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            // Check whether this event was raised for a column's context menu.
            if (e.MenuType != GridMenuType.Column)
            {
                return;
            }

            // Remove the Column Chooser menu item.
            e.Customizations.Add(new RemoveBarItemAndLinkAction()
            {
                ItemName = DefaultColumnMenuItemNames.ColumnChooser
            });

            // Create a custom menu item and add it to the context menu.
            BarButtonItem bi = new BarButtonItem();

            bi.Name       = "customItem";
            bi.Content    = "Custom Item";
            bi.ItemClick += new ItemClickEventHandler(customItem_ItemClick);
            e.Customizations.Add(bi);
        }
示例#21
0
 private void gridViewMappedPhrases_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     popupMappedPhrases.ShowPopup(gridControlMappedPhrases.PointToScreen(e.Point));
 }
示例#22
0
        private void gridViewRqmt_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            try
            {
                GridView view = gridViewRqmt;
                    
                //No need to test for single row selected since that's controlled by the grid property.
                string rqmtCode = view.GetRowCellDisplayText(view.FocusedRowHandle, "Rqmt");
                string status = view.GetRowCellDisplayText(view.FocusedRowHandle, "Status");
                string finalApprovalFlag = view.GetRowCellDisplayText(view.FocusedRowHandle, "FinalApprovalFlag");
                long tradeId = long.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "TradeId").ToString());
                long rqmtId = long.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "Id").ToString());
                string preparerCanSendFlag = GetContractConfirmData(tradeId, "PreparerCanSendFlag");

                if (e.Menu == null || e.Menu.GetType() == typeof(DevExpress.XtraGrid.Menu.GridViewMenu))
                {
                    if (rqmtCode == SEMPRA_RQMT)
                    {
                        //string paperCreator = "";
                        //bool isPaperCreator = true;
                        bool finalApproved = (finalApprovalFlag == "Y");
                        bool cancelled = status == "CXL";
                        if (status == "NEW")
                        {
                            barBtnAddEditConfirm.Enabled = !finalApproved && isHasUpdate;
                            barBtnAddEditConfirm.Caption = "Get Confirm";
                        }
                        else
                        {
                            barBtnAddEditConfirm.Enabled = (gridViewConfirm.RowCount > 0) && !finalApproved && !cancelled && isHasUpdate;
                            barBtnAddEditConfirm.Caption = "Edit Confirm";
                            //5/27/09 Israel -- Creator can't approve
                            long rqmtConfirmId = GetContractRowId(tradeId);
                            //Israel 9/22/2015
                            //paperCreator = GetPaperCreator(rqmtConfirmId);
                            //if (Properties.Settings.Default.RunDemo.Equals("Y"))  // DEMO ENVIRONMENT...KEEP OKTOSEND ENABLED.
                            //{
                            //    isPaperCreator = false;
                            //}
                            //else
                            //{
                            //    isPaperCreator = (paperCreator == toolbarOrWindowsUserId.ToUpper());
                            //}
                        }

                        barBtnSelectManualTemplate.Enabled = (status == "NEW") && !finalApproved && !cancelled && isHasUpdate;
                        barBtnCreateAdditionalConfirm.Enabled = (gridViewConfirm.RowCount > 0) &&
                           !finalApproved && !cancelled && isHasUpdate;

                        barbtnRqmtSetToPrep.Enabled = (status == "TRADER" || status == "EXT_REVIEW" ||
                           status == "MGR" || status == "OK_TO_SEND" || status == "SENT") && !finalApproved && isHasUpdate;

                        // New and Cancel are controlled via security and are set to visible in ApplyUserAccess()
                        barbtnRqmtSetToNew.Enabled = (status == "PREP" || status == "CXL") && !finalApproved && isHasUpdate;
                        barbtnRqmtCancel.Enabled = (status != "CXL") && !finalApproved && !cancelled && isHasUpdate;

                        string faxTelexNumber = GetContractConfirmData(tradeId, "FaxTelexNumber");
                        bool enableOkAndSend = (status == "MGR") && (faxTelexNumber.Trim().Length > 2) &&
                                               (!finalApproved && !cancelled && isHasUpdate);
                        bool enableSend = (status == "OK_TO_SEND") && faxTelexNumber.Trim().Length > 2 &&
                           !finalApproved && !cancelled && isHasUpdate;
                        bool enableResend = ((status == "SENT") ||
                                             (status == "FAIL") ||
                                             (status == "DISP") ||
                                             (status == "APPR") ||
                                             (status == "SIGNED") ||
                                             (status == "ACPTD") ||
                                             (status == "RESNT")) && faxTelexNumber.Trim().Length > 2 &&
                                             !finalApproved && !cancelled && isHasUpdate;

                        ChangeRQMTContextMenuVisibility(preparerCanSendFlag == "Y");

                        barbtnRqmtSetToOkToSend.Enabled = enableOkAndSend;
                        barbtnRqmtSetToOkAndSend.Enabled = enableOkAndSend;
                        barbtnRqmtSetToOkAndManualSend.Enabled = (status == "MGR") &&
                           !finalApproved && !cancelled && isHasUpdate;

                        barbtnRqmtSend.Enabled = enableSend;
                        barbtnRqmtResend.Enabled = enableResend;
                        barbtnRqmtManualSend.Enabled = (status == "OK_TO_SEND" || status == "FAIL") &&
                           !finalApproved && !cancelled && isHasUpdate;
                        //5/22/09 Israel - Only show Print button when there is a contract to print.
                        barbtnRqmtPrint.Enabled = IsContractOkToPrint(tradeId);

                        popupSempraRqmt.ShowPopup(gridRqmt.PointToScreen(e.Point));
                    }
                    else
                    {
                        if (isHasUpdate)
                        {
                            popupAllRqmts.ShowPopup(gridRqmt.PointToScreen(e.Point));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("An error occurred while attempting to enable/disable Requirement Grid menu items." + Environment.NewLine +
                       "Error CNF-107 in " + FORM_NAME + ".gridViewRqmt_ShowGridMenu(): " + ex.Message,
                     MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#23
0
        private void grvSelectedFiles_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            GridHitInfo hitInfo = grvSelectedFiles.CalcHitInfo(e.Point);

            switch (e.MenuType)
            {
                case GridMenuType.Row:
                    grvSelectedFiles.FocusedRowHandle = hitInfo.RowHandle;
                    mnuSelectedFiles.ShowPopup(this.ctlCommandManager, grdSelectedFiles.PointToScreen(e.Point));
                    break;

                case GridMenuType.User:
                    mnuSelectedFiles.ShowPopup(this.ctlCommandManager, grdSelectedFiles.PointToScreen(e.Point));
                    break;
            }
        }
示例#24
0
 private void gvAlerts_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     e.Allow = false;
 }
示例#25
0
        private void gridViewInboundDocs_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            try
            {
                //Israel --Adds the fixed options to column customization
                if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
                {
                    DevExpress.XtraGrid.Menu.GridViewColumnMenu menu = e.Menu as DevExpress.XtraGrid.Menu.GridViewColumnMenu;
                    if (menu.Column != null)
                    {
                        menu.Items.Add(CreateCheckItem("Not Fixed", menu.Column, FixedStyle.None, imageList2.Images[0]));
                        menu.Items.Add(CreateCheckItem("Fixed Left", menu.Column, FixedStyle.Left, imageList2.Images[1]));
                        menu.Items.Add(CreateCheckItem("Fixed Right", menu.Column, FixedStyle.Right, imageList2.Images[2]));
                    }
                }

                if (e.Menu == null || e.Menu.GetType() == typeof(DevExpress.XtraGrid.Menu.GridViewMenu))
                {
                    popupMain.ShowPopup(gridControlInboundDocs.PointToScreen(e.Point));
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("An error occurred while displaying the popup menu." + Environment.NewLine +
                       "Error CNF-526 in " + FORM_NAME + ".gridViewInboundDocs_ShowGridMenu(): " + ex.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#26
0
        private void grvResult_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            GridView view = sender as GridView;
            if (view != null)
            {
                GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
                switch (e.MenuType)
                {
                    case GridMenuType.Row:
                        view.FocusedRowHandle = hitInfo.RowHandle;
                        goto case GridMenuType.User;

                    case GridMenuType.User:
                        FocusedRowChanged(view.FocusedRowHandle);
                        mnuResult.ShowPopup(this.ctlCommandManager, this.grdResult.PointToScreen(e.Point));
                        break;
                }
            }
        }
 void AssociatedObject_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     e.MenuInfo.Menu.Closed += Menu_Closed;
     isInMenu = true;
 }
示例#28
0
 public virtual void ShowGridMenuAction(GridMenuEventArgs e)
 {
     throw new NotImplementedException();
 }
示例#29
0
 private void gridViewMatchedDocuments_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     popupMatchedDocs.ShowPopup(gridMatchedDocuments.PointToScreen(e.Point));
 }
 /// <summary>
 /// Handles the ShowGridMenu event of the gridView1 control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see>
 ///                       <cref>GridMenuEventArgs</cref>
 ///                     </see> instance containing the event data.</param>
 private void gridView1_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     var view = sender as GridView;
     if (view != null && e != null)
     {
         GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
         if (hitInfo.InRow)
         {
             view.FocusedRowHandle = hitInfo.RowHandle;
             contextMenuStrip2.Show(view.GridControl, e.Point);
         }
     }
 }
示例#31
0
        private void gridViewConfirm_ShowGridMenu(object sender, GridMenuEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                if (view.RowCount == 0)
                    return;
                int rqmtId = int.Parse(view.GetRowCellDisplayText(view.FocusedRowHandle, "RqmtId"));
                string faxTelexNumber = view.GetRowCellDisplayText(view.FocusedRowHandle, "FaxTelexNumber");
                string status = "";
                string confirmLabel = view.GetRowCellDisplayText(view.FocusedRowHandle, "ConfirmLabel");
                string activeFlag = view.GetRowCellDisplayText(view.FocusedRowHandle, "ActiveFlag");
                bool activeConfirm = (activeFlag == "Y");
                string finalApprovalFlag = gridViewSummary.GetRowCellDisplayText(gridViewSummary.FocusedRowHandle, "FinalApprovalFlag");
                bool finalApproved = (finalApprovalFlag == "Y");

                if (confirmLabel == CONFIRM_LABEL_CONFIRM)
                    status = GetTradeRqmtData(rqmtId, "Status");
                else
                    status = view.GetRowCellValue(view.FocusedRowHandle, "NextStatusCode").ToString();
                bool cancelled = status == "CXL";

                //No need to test for single row selected since that's controlled by the grid property.
                if ((e.Menu == null || e.Menu.GetType() == typeof(DevExpress.XtraGrid.Menu.GridViewMenu)))
                {
                    bool faxTelexOk = faxTelexNumber.Trim().Length > 2;
                    bool enableSend = (status == "OK_TO_SEND") && !finalApproved && !cancelled && isHasUpdate;
                    bool enableResend = ((status == "SENT") ||
                                         (status == "FAIL") ||
                                         (status == "DISP") ||
                                         (status == "APPR") ||
                                         (status == "SIGNED") ||
                                         (status == "ACPTD") ||
                                         (status == "RESNT")) && !finalApproved && !cancelled && isHasUpdate;

                    barBtnEditConfirm.Enabled = !cancelled && !finalApproved && isHasUpdate;

                    barBtnConfirmSendPaper.Enabled = enableSend && faxTelexOk && activeConfirm;
                    barBtnConfirmResendPaper.Enabled = enableResend && faxTelexOk && activeConfirm;
                    barBtnConfirmChangeFaxNoSendResend.Enabled = (enableSend || enableResend) && activeConfirm;
                    //6/15/09 Israel -- added faxTelexOk test
                    barBtnConfirmSendResendRTF.Enabled = (enableSend || enableResend) && faxTelexOk;
                    barbtnConfirmManualSend.Enabled = (status == "OK_TO_SEND" || status == "FAIL") &&
                                                       !cancelled && !finalApproved && isHasUpdate && activeConfirm;

                    barBtnCreateAdditionalConfirm2.Enabled = gridViewConfirm.RowCount > 0 && !finalApproved && isHasUpdate;

                    if (confirmLabel == CONFIRM_LABEL_CONFIRM)
                        barBtnCancelAdditonalConfirm.Visibility = BarItemVisibility.Never;
                    else
                    {
                        barBtnCancelAdditonalConfirm.Visibility = BarItemVisibility.Always;
                        barBtnCancelAdditonalConfirm.Enabled = ((status != "SENT") && (status != "CXL")) && !finalApproved && isHasUpdate;
                    }

                    barbtnConfirmPrint.Enabled = !cancelled;

                    popupConfirm.ShowPopup(gridConfirm.PointToScreen(e.Point));
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("An error occurred while attempting to enable/disable Confirm Grid menu items." + Environment.NewLine +
                      "Error CNF-108 in " + FORM_NAME + ".gridViewConfirm_ShowGridMenu(): " + ex.Message,
                    MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void gridViewTaiNguyen_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     if (e.MenuType == GridMenuType.Column)
     {
         try
         {
             GridViewColumnMenu menu = (GridViewColumnMenu)e.Menu;
             if (menu.Column == null)
             {
                 e.Allow = false;
                 return;
             }
             DXMenuCheckItem menuItemCheckAll = new DXMenuCheckItem("Chọn tất cả",
                        IsShowCheckForCheckAllItem(gridViewTaiNguyen, menu.Column), null,
                        new EventHandler(ProcessCheckAll));
             menuItemCheckAll.BeginGroup = true;
             DXMenuCheckItem menuItemUnCheckAll = new DXMenuCheckItem("Bỏ chọn tất cả",
                        IsShowCheckForUnCheckAllItem(gridViewTaiNguyen, menu.Column), null,
                        new EventHandler(ProcessUnCheckAll));
             if (menu.Column.FieldName == "ISCREATE_BIT"
                 || menu.Column.FieldName == "ISREAD_BIT"
                 || menu.Column.FieldName == "ISUPDATE_BIT"
                 || menu.Column.FieldName == "ISDELETE_BIT"
                 || menu.Column.FieldName == "ISFULL_BIT")
             {
                 menuItemCheckAll.Tag = menu.Column;
                 menuItemUnCheckAll.Tag = menu.Column;
                 menu.Items.Add(menuItemCheckAll);
                 menu.Items.Add(menuItemUnCheckAll);
             }
         }
         catch
         {
             HelpMsgBox.ShowErrorMessage(
                 "Chương trình xảy ra lỗi.\nXin vui lòng liên hệ với quản trị hệ thống!");
             e.Allow = false;
         }
     }
 }
示例#33
0
 private void gridView2_ShowGridMenu(object sender, GridMenuEventArgs e)
 {
     var view = (GridView) sender;
     GridHitInfo hitInfo = view.CalcHitInfo(e.Point);
     if (hitInfo.InRow)
         popupMenuPerfomance.ShowPopup(MousePosition);
 }