Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I use three colors(Red, Amber and Green) for rows in my treelist control based on the datatable soucre data.

                                    Let suppose I have five columns in my datasource, like IsRed, IsAmber, IsGreen, Title and Date. I color code rows in treelist using the data present in datasoure columns (IsRed, IsAmber, IsGreen) by using the TreeList.NodeCellStyle event as follows.

                                    if (Convert.ToString(e.Node["IsGreen"]) == "True")
                                                    {
                                                        e.Appearance.BackColor = Color.LightGreen;
                                                    }
                                                    else if (Convert.ToString(e.Node["IsAmber"]) == "True")
                                                    {
                                                        e.Appearance.BackColor = Color.Orange;
                                                    } While loading the treelist for the first time, I am able to populate treelist correctly with color using these conditions. I also use CheckEditItem in my treelist control.

                                    Now my problem is, when I select/unselect the CheckEditItem , I need to change the background color to Green whenever I select it and retain its original color when un select it. Can you please suggest a better way to accomplish this.

                                    Thank you.

                                • Try the attached sample project and let me know whether or not it meets your requirements.

                                • Ranjith Vushakola 1 12.10.2012

                                  Thank you John. This works for me as expected. Appreciate for your quick response.

                                • You are welcome.
                                  I am glad to hear that you have found my assistance helpful. Please feel free to contact us in case of any difficulties.

                                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