Ticket T528044
Visible to All Users

Set background color for group in web

created 8 years ago

Hello
Im trying to color layout group in web and found this article:
https://www.devexpress.com/Support/Center/Question/Details/B209790/conditional-appearance-backcolor-not-working-as-expected-for-layoutgroups-and-tabbedgroups
But it doesn't works, because Controls always 0 in all groups. I also tried several solutions but also unsuccessfully and have no idea how could I paint a group. How could I paint my control group in layout?

I have reproduced it at main demo and attached controller for you.

Answers approved by DevExpress Support

created 8 years ago (modified 7 years ago)

Hello Andrey,

If you are using the New Web UI, you can easily accomplish this task without coding using the CustomCSSClassName model property. Add a style with the required settings to the Default.aspx page, e.g.:

CSS
.YellowGroup { background-color: yellow; }

Then, assign the name of this style (YellowGroup) to the CustomCSSClassName property of the required Layout Group in the Model Editor. Refer to the How to: Customize ASP.NET Layout Elements Using Custom CSS Classes topic for additional information.

Alternatively, subscribe to the template container's Init or Load event to get its controls. I have updated the example from the Conditional Appearance BackColor not working as expected for LayoutGroups and TabbedGroups ticket to demonstrate this solution.

    Comments (2)

      thanks, this works!

      Anatol (DevExpress) 8 years ago

        You are welcome!

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.