Ticket A871
Visible to All Users

How to hide the Expand buttons for grouping rows

created 21 years ago (modified 2 years ago)

Description:
Sometimes grouping is used to create a particular structure to represent data and it is undesirable to allow users to collapse any grouping row. Is there any way of hiding the expand buttons and prevent users from collapsing group rows?

Answer:
The solution to this problem is to create a new View class which will support this functionality itself. This will prevent you from having to alter our source code everytime you install a new update of the ExpressQuantumGrid Suite.
The ExpressQuantumGrid has a rather flexible structure which allows you to change practically any aspect of its behavior by creating a new View class. A number of such examples are posted in the How to Utilize the QuantumGrid's Flexibility to Implement a New Feature in a Derived Class article…
The behavior you asked about is defined by the TcxGridGroupRow.GetExpandable method. So, basically, you need to alter the GridView's implementation in such a way, that it uses your own class instead of the TcxGridGroupRow. Here is the chain which demonstrates how an object of the TcxGridGroupRow class is created:
TcxCustomGridView.CreateHandlers
TcxGridTableView.GetViewDataClass
TcxGridViewData.CreateRecord
TcxGridViewData.GetRecordClass
In your case, you need to create the following classes:
TmycxGridDBTableView - override the GetViewDataClass method
TmycxGridViewData - override the GetRecordClass method
TmycxGridGroupRow - override the GetExpandable method.
Attached you will find a sample project which demonstrates how this can be implemented. We hope it will be helpful to you.

Show previous comments (1)
DevExpress Support Team 12 years ago

    Hi Andrei,
    You are entirely correct. You can use this option to make Groups always expanded.

      Ingvar, it doesn't work for me. I have Master-Detail layout, both views' dsoGroupsAlwaysExpanded are set to True, yet detail views come out collapsed and "+/-" buttons are present in both views. Help?
      Thanks
      Alex

      DevExpress Support Team 11 years ago

        Hello,
        The dsoGroupsAlwaysExpanded option works for group rows, but not for the master-detail relationship. I suggest that you refer to the Detail Views always expanded and without indent ticket for a solution. Please take a look at my example in comments there. I believe you will find it useful.

        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.