Exemple #1
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
         });
     }
 }
Exemple #2
0
        void ProsView_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            DevExpress.XtraGrid.Menu.GridViewColumnMenu menu = e.Menu as DevExpress.XtraGrid.Menu.GridViewColumnMenu;
            if (menu == null)
            {
                return;
            }

            for (int i = 0; i < menu.Items.Count; i++)
            {
                if (e.Menu.Items[i].Caption == "Column Chooser")
                {
                    e.Menu.Items[i].Visible = false;
                }
            }
        }