Ticket T663637
Visible to All Users

Set different text alignment for different column headers

created 7 years ago

Hello,
I want the New button in the command column header to be aligned to the Center and the text of the rest of the column headers to aligned to the right.
Is this possible?
Thank you
Dov

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

Hi Dov,

You can assign the common header style for all columns using the Header.HorizontalAlign property and overwrite this property for the command column:

ASPx
<dx:ASPxGridView ID="ASPxGridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ShipperID"> <Styles> <Header HorizontalAlign="Right"></Header> </Styles> <Columns> <dx:GridViewCommandColumn ShowNewButton="true" ShowEditButton="true" ShowNewButtonInHeader="true"> <HeaderStyle HorizontalAlign="Center" /> </dx:GridViewCommandColumn> .... </Columns> </dx:ASPxGridView>

Let me know if you need further assistance.

    Comments (2)

      Hello Marina,
      That's exactly what I need. I overlooked that.
      Thank you very much!
      Dov

      DevExpress Support Team 7 years ago

        Dov,

        I am happy to hear that my assistance was helpful!
        Should you have further questions, feel free to contact us at any time.

        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.