Ticket Q364842
Visible to All Users

Expand/collapse Group when click on group header

created 13 years ago

When I have a grid that groups items is there a way to expand/collapse the group when the user clicks on the text in the header? Right now the only way to expand/collapse a group is to click on the expand button in the header.

Comments (1)
DevExpress Support Team 13 years ago

    Hi Frank,
    Thank you for contacting us.
    To accomplish your task handle the MouseLeftButtonUp event in the following manner:

    C#
    private void tableView1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { TableView view = sender as TableView; TableViewHitInfo hi = view.CalcHitInfo(e.OriginalSource as DependencyObject); if (hi.HitTest == TableViewHitTest.GroupValue) ToggleExpandedState(view); } private void ToggleExpandedState(TableView view) { if (view.Grid.IsGroupRowExpanded(view.FocusedRowHandle)) view.CollapseFocusedRow(); else view.ExpandFocusedRow(); }

    If you need any further assistance with this subject, please feel free to reactivate this ticket.
    Thanks
    Dimitros

    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.