Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I'm working with a Master-Child grid. When the master row is expanded the child grid is shown. Now I want to give the child grid another background color.

                                    How can I achieve this??

                                    best regards.
                                    Lanzo van Slooten

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi Lanzo,

                                To achieve this goal, you can use the RowStyle property in the following manner:

                                [XAML]
                                <dxg:GridControl ...> <dxg:GridControl.DetailDescriptor> <dxg:DataControlDetailDescriptor ...> <dxg:GridControl> <dxg:GridControl.View> <dxg:TableView> <dxg:TableView.RowStyle> <Style TargetType="dxg:GridRowContent"> <Setter Property="Background" Value="Red"/> </Style> </dxg:TableView.RowStyle> </dxg:TableView> </dxg:GridControl.View> </dxg:GridControl> </dxg:DataControlDetailDescriptor> </dxg:GridControl.DetailDescriptor> </dxg:GridControl>

                                Let me know if you need further assistance.

                                Thanks

                                • Lanzo van Slooten 06.10.2013

                                  But RowStyle will not change the color of the header and the grouping row.

                                  Lanzo

                                • To change these elements' appearance, perform the following steps:

                                  1. Override the GridViewBase.GroupRowStyle template in the manner demonstrated in my answer.

                                  2. Override the {dxgt:GridColumnHeaderThemeKey ResourceKey=ControlTemplate} control template. Please refer to the How to programmatically (VB) set the background color of a column header in DXGrid thread, where you can find an example demonstrating how to do this. Additionally, review the KA18580 KB article describing how to customize our themes for WPF.

                                  If you face difficulties accomplishing this task, feel free to contact us.

                                  Thanks

                                You must  log in  or  register  to leave comments

                                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