Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,

                                    I'm populating a TreeListControl with a DataTable and I want to alter row background color according to field values in the data table. I have a field (lets call it acil) and it can only be true or false, If the value is true the background of that row should be red. What am I doing wrong?

                                    <Window.Resources>
                                    <Style x:Key="customRowStyle" TargetType="{x:Type dxg:GridRowContent}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=acil}" Value="True"> <Setter Property="Background" Value="Red" /> <Setter Property="Foreground" Value="Whitesmoke" /> </DataTrigger> </Style.Triggers> </Style> </Window.Resources>




                                    <dxg:TreeListControl.View> <dxg:TreeListView Name="view_islistesi" ShowTotalSummary="True" RowStyle="{StaticResource customRowStyle}" /> </dxg:TreeListControl.View>


                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hello Oguz,
                                Thank you for your question. Since the row data context is the TreeListRowData object, it is necessary to modify your binding path as follows:

                                [XAML]
                                <DataTrigger Binding="{Binding Row.acil}" Value="True">
                                I have attached a sample to demonstrate how to accomplish your task.
                                Do not hesitate to ask for additional clarification if necessary.

                                • Oguz Tugrul 12.19.2012

                                  Alexander thanks for the quick response, it works as it should be.

                                • You are welcome, Oguz. I'm glad to hear that my assistance was helpful.

                                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