Ticket T926311
Visible to All Users

Fixed Columns in Grid (New Feature) - Question about Pop up menu

created 5 years ago

Hello,

This fixed Column feature is of great interest. However, I need it to be set by the end user - not by me in the program.

I was reading your documentation at the page below - and makes reference to a Demo that shows how to give the end user the ability to do this. however, when I click on it - it does not do anything. You may want to check the link.
dxdemo://Win/XtraGrid/MainDemo/FixedColumns

About midway on the following page:
https://docs.devexpress.com/WindowsForms/3483/controls-and-libraries/data-grid/views/grid-view/columns?v=20.2#fixed-columns

Currently in the Grid - I make use of your default popup menu - and it is important to my users.

So - my question is if I used Fixed Columns - can I still use the standard menu - but allow another menu item that allows the user to set whether this columns is fixed or not?

Thank you.

Answers approved by DevExpress Support

created 5 years ago

Hello,
While this functionality isn't available out of the box, you can handle the PopupMenuShowing event as demonstrated in the FixedColumns demo, but don't clear the existing items. To do this, remove menu.Items.Clear(); from the gridView1_PopupMenuShowing event handler:

C#
private void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.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.Clear(); <<<<<<<<<< remove this line ... } }

I hope this information is helpful. Should you have additional questions, let me know. I'll be happy to follow up.

    Show previous comments (2)
    DevExpress Support Team 5 years ago

      the link to the Fixed Column project/demo does not work

      In order not to mix different questions in one thread, I created a separate ticket on your behalf: T926800: DevExpress demo links cannot be opened. Please refer to it.

      Could you attach that project here?

      Sure, I created and attached a project. Please check it and let me know if you have additional questions.

      GM GM
      George MacDonald 5 years ago

        Stas,

        This is exactly what I was hoping for. It works really well!! I have it implemented already.

        Now - do you plan on making these menu items part of the standard menu when you release the final product?

        Bradley

        DevExpress Support Team 5 years ago

          We don't have immediate plans to add these new items to the Column menu.
          We are now collecting feedback regarding this feature. I forwarded your request to the team. Once we decide to implement this feature, we will announce it on our What's New page.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.