Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello I would like to find a way to show a context menu on group row on table view.
                                    I would like to operate on all rows from the selected group.
                                    I tried the selection changed event which does not work. Is there another option?

                                    Thanks,
                                    Andrei

                                • Hi,

                                  By default, the GridControl shows the context menu only for usual rows. Also, your scenario is not clear to me. Please explain the behavior which you wish to implement in greater detail. It will help me to provide you with the best solution. I am looking forward to your response.

                                • Andrei Isac 03.12.2013

                                  Hi,
                                  I have a table showing computer entries id, name, location, etc.
                                  I want to group by location and right click the group row and choose for example to select all rows in the group for some action.

                                  Thanks,
                                  Andrei

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi Andrei,

                                Thank you for the clarification. At the moment, the simplest way to achieve this goal is to override the GridViewBase.GroupRowStyle style and set the BarManager.DXContextMenu property there.
                                For example:

                                	
                                [XAML]
                                <dxg:TableView x:Name="view"> <dxg:TableView.GroupRowStyle> <Style TargetType="dxg:GroupGridRowContent"> <Setter Property="dxb:BarManager.DXContextMenu"> <Setter.Value> <dxb:PopupMenuInfo> <dxb:BarButtonItemLink BarItemName="item1"/> <dxb:BarButtonItemLink BarItemName="item2"/> </dxb:PopupMenuInfo> </Setter.Value> </Setter> </Style> </dxg:TableView.GroupRowStyle> </dxg:TableView>

                                In the meantime, we agree that it makes sense to provide this functionality out-of-the-box and will consider implementing it when planning features for further releases. You can add the DXGrid - Provide a built-in context menu for group rows thread to your favorites to be notified when this feature is available.

                                Thanks

                                • Andrei Isac 03.12.2013

                                  Thanks a lot for the solution provided.
                                  I would like to ask what is the correct way to retrieve the group row which was last selected.
                                  For some reason FocusedRrowxhanged event does not work.

                                  Thanks,
                                  Andrei

                                • Andrei Isac 03.12.2013

                                  Hello again,

                                  Just to update the above question I used CalcHitInfo and stored hi.RowHandle in a member variable. Thus I can loop over child items processing them with the action selected by the popup menu.

                                  Thanks again,
                                  Andrei

                                • Hi Andrei,

                                  You can access the GroupRowData object via the e.Link.LinkControl property in the following manner:

                                  private void item_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
                                  	BarPopupBorderControl barPopupBorderControl = LayoutHelper.FindParentObject<BarPopupBorderControl>(e.Link.LinkControl);
                                  	PopupMenu popupMenu = barPopupBorderControl.Parent as PopupMenu;
                                  	GroupGridRowContent groupGridRowContent = popupMenu.PlacementTarget as GroupGridRowContent;
                                  	GroupRowData groupRowData = groupGridRowContent.DataContext as GroupRowData;
                                  	// ...
                                  }

                                  Let me know if you need further assistance.

                                  Thanks

                                • Andrei Isac 03.13.2013

                                  Hello,

                                  Thanks for the provided solution.
                                  It works better than the CalcHitInfo method.

                                  Thanks,
                                  Andrei

                                You must  log in  or  register  to leave comments

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners