Current filter:
                                You should refresh the page.
                                  • Hi

                                    I am using the WPF grid control and I am dynamically generating the columns using the Columns Source and ColumnTemplateGenerator properties. Now I want to have different background columns for different columns baaed on some property in objects used in the collection used as Binding for ColumnsSource property.

                                    I have already tried using CellTemplate in TreeListView and setting the backgroundcolor and getting the color using converter but it fires only once and some columns are not shown when the grid is initially loaded and if I show the columns using the colon choose the colors are not there.

                                    Please suggest.


                                • Andrey Marten (DevExpress Support) 07.24.2019


                                  If you want to highlight cells in certain columns, the use of custom CellStyle or/and CellTemplate is a proper solution.

                                  It's difficult to diagnose the issue that you faced with this approach based on your description. I can only assume that the properties that you use to determine cell colors do not raise the PropertyChanged event. As a result, your bindings do not update. If this is not the case, please upload a simple sample illustrating your current implementation so that we can research it.


                                1 Solution

                                Creation Date Importance Sort by

                                Thanks i figured out the problem with my implementation.

                                The key was how I accessed the Column properties in the cell style. i had to use "Column" in the path in cell style

                                <Style x:Key="CellStyle" BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=LightweightCellStyle}}" TargetType="dxg:LightweightCellEditor"> <Setter Property="Background" Value="{Binding Path=Column.(dxci:DependencyObjectExtensions.DataContext).BackgroundColor}"/> </Style>
                                • Andrey Marten (DevExpress Support) 07.25.2019

                                  I'm happy to hear that. Thank you for keeping us informed.
                                  Feel free to contact us if you have additional questions.