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

                                    I would like to set the background color of individual rows in my Silverlight GridControl based on the value of a property in bound data.

                                    i.e. If the bound data items contain a boolean property called "Available" then I would like the entire grid row for an item where the "Available" property is false to have a grey backround and where the "Available" property is true to have a green background.

                                    I have reviewed the documentation at http://documentation.devexpress.com/#Silverlight/CustomDocument5242 and am able to set the cell template as per the example given however I cannot figure how to achieve the required effect on rows.

                                    Your help would be appreciated.

                                    Regards AndyB

                                0

                                Hi Andy,

                                I have attached a sample illustrating how to accomplish this task.
                                Please try this solution and let us know the results.

                                Thanks,
                                Andrew

                                0

                                Hi Andrew,

                                Thanks for your sample project. This solution worked perfectly.

                                However, there is a little problem.

                                The solution is fine provided the flag I use to set the color does not change.

                                If I change the value of the flag used to select the row color the INotifyChanged interface signals the changed state to the flag editor in the row but the row color does not change to reflect the new value.

                                Is there a solution to this problem?

                                I have attached a project that demonstrates the issue.

                                Regards

                                AndyB

                                0

                                Hi Andy,

                                Please modify your binding to fix this issue to "Row.Marked"
                                For example :

                                [XAML]
                                <Binding Path="Row.Marked"> <Binding.Converter> <dx:BoolToObjectConverter TrueValue="Green" FalseValue="Gray"/> </Binding.Converter> </Binding>
                                Please try this solution, and let us know the results.

                                Thanks,
                                Andrew

                                0

                                Thank you Andrew.

                                The new binding has solved the problem and all is now working correctly.

                                Regards AndyB

                                0

                                Hi Andy,

                                I am glad to hear that the problem has been resolved. Thank you for letting us know of your progress.
                                Please feel free to contact us in case of any difficulty. We will be happy to assist you.

                                Thanks,
                                Andrew

                                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