Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • In the attached image, you can two issues:

                                    1) the selected cell has a white background color instead of the desired blue highlight

                                    2) the selected row keeps the grid column background colors instead of the desired blue highlight


                                    I've set the background property on the CellStyle of the columns - but I don't want that background color to override the standard 'blue' selection background color:


                                    <dxg:TreeListControl AutoPopulateColumns="True" HorizontalAlignment="Stretch" Name="treeList" VerticalAlignment="Stretch">

                                    <dxg:TreeListControl.Resources>

                                    <Style x:Key="attrBackground"

                                    BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=CellStyle}}"

                                    TargetType="dxg:CellContentPresenter">

                                    <Setter Property="Background" Value="Linen"/>

                                    </Style>

                                    </dxg:TreeListControl.Resources>

                                    <dxg:TreeListControl.Columns>

                                    <dxg:TreeListColumn AllowSorting="True" FieldName="Generated_Date" Header="Generated On" Width="130" />

                                    <dxg:TreeListColumn AllowSorting="True" FieldName="Act_Vol_Shrinkage" Header="Act Vol Shrink" CellStyle="{StaticResource attrBackground}">

                                    <dxg:TreeListColumn.EditSettings>

                                    <dxe:TextEditSettings MaskType="Numeric" MaskUseAsDisplayFormat="True" Mask="p" />

                                    </dxg:TreeListColumn.EditSettings>

                                    </dxg:TreeListColumn>

                                    </dxg:TreeListControl.Columns>

                                    <dxg:TreeListControl.View>

                                    <dxg:TreeListView AllowEditing="False" Name="treeListView" ShowTotalSummary="False" />

                                    </dxg:TreeListControl.View>

                                    </dxg:TreeListControl>

                                You must  log in  or  register  to leave comments

                                1 Solution

                                1

                                Hello Craig,
                                Thank you for your inquiry. Since you are not editing data in a TreeList, I suggest you set the NavigationStyle property to Row, so the editor will not show up and the cell will not be highlighted specifically. As for the focused row background, move the style setter to the trigger as follows:

                                [XAML]
                                <Style x:Key="attrBackground" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=CellStyle}}" TargetType="dxg:CellContentPresenter"> <Style.Triggers> <DataTrigger Binding="{Binding RowData.IsFocused}" Value="False"> <DataTrigger.Setters> <Setter Property="Background" Value="Linen"/> </DataTrigger.Setters> </DataTrigger> </Style.Triggers> </Style>
                                This will prevent re-coloring of the focused row background.
                                Please take a moment to review this solution and let us know of your results.

                                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