Ticket T106647
Visible to All Users

TcxGridLayoutView - possibility to set LayoutItem header style

created 11 years ago

I have replaced TcxVerticalGrid with TcxGridLayoutView in my new application. It looks better and has more advanced options of customization, but i used to mark captions of some vertical grid rows (for example those for required fields) by different style. In LayoutItem i can only set style of content but not of header.

Can you please add a possibility to set a style of LayoutItem header/caption? It would be very useful in my application.

Greetings from Prague
Jaroslav

Answers approved by DevExpress Support

created 11 years ago

Hello Jaroslav,

You can set the <ALayoutView>.Styles.Item property to the TcxStyle object to apply a style to LayoutItems' headers.
Attached is an example that demonstrates this approach in action. I hope this will help you achieve the required functionality.

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

      Hello Jaroslav,

      Thank you for the clarification. In this case, you can use the LayoutView.Styles.OnGetItemStyle event to apply your styles to required Items. For example:

      Delphi
      procedure <AForm>.<ALayoutView>StylesGetItemStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); begin   if AItem <> nil then   begin     if (AItem = <AColumn>) then       AStyle := <AcxStyle>     else       AStyle := <BcxStyle>;   end; end;

      I hope that this information helps.

      JN JN
      Jaroslav Nechyba 11 years ago

        Thank you for the response,
        i've tried solution you've recommended and it works but unfotunately just particularly. New style is dynamically assigned in  but only it's "TextColor" property is really used as item's header style. It's font properties stays the same. Is this a bug?
        Attaching a sample project.

        DevExpress Support Team 11 years ago

          Hello Jaroslav,

          This behavior is by design. You can set only common font settings for all LayoutView Items. However, to accomplish your task, you can try to use the LayoutView.OnCustomDrawCell event handler. This approach was described in the Q333867: How to change default row captions's color of the grid layout view ? ticket. Please take a look at it.

          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.