Ticket Q234403
Visible to All Users

ASPxGridView - Change color of Column header by condition when using theme

created 15 years ago

Hi,
I use AspxGridView and Aqua theme. I have grid with lot of columns and I need chance color of column header to different as green, red by some condition.
Is it posible and how can I do It.
Thanks for help
Martin Radvansky

Answers

created 15 years ago (modified 12 years ago)

Hi Martin,
You can set the column header color using the GridViewColumn.HeaderStyle.BackColor property. If you are using some theme, the header cell contains an image, which covers the cell area.
To overcome this issue, remove the backround-image property from the dxgvHeader_Aqua css class and set the column header color.

CSS
.dxgvHeader_Aqua { ... /*background-image: url('gvHeaderBackground.gif');*/ ... }
ASPx
... <dxwgv:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="1"> <HeaderStyle BackColor="Green" /> </dxwgv:GridViewDataTextColumn> ...

I've created a sample project with this solution. It's attached. Please see it, and let us know if this helps.
Thanks,
Ruslan

    Show previous comments (1)
    DevExpress Support Team 12 years ago

      Hello,
      Would you please describe your scenario in greater detail? Please clarify what you mean by "how to apply that in devexpress Razor".
      We greatly appreciate your time and cooperation.

      DevExpress Support Team 12 years ago

        [DX Support team: this comment was created from the Owner's answer]
        I didn't find any css
        .dxgvHeader_Aqua {

        /*background-image: url('gvHeaderBackground.gif');*/

        }

        Please let me know where will i get and and how to make the changes.

        DevExpress Support Team 12 years ago

          Hi,
          you can use the ASPxThemeDeployer tool to copy the specific Theme's source files into the project's App_Theme folder.
          Please refer to the following link for the step-by-step instructions on how to use this tool.
          Using ASPxThemeDeployer.

          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.