We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Align text in header of GDBG

Thread ID:





34879 Sep 19,2005 10:15 AM UTC Sep 20,2005 08:43 AM UTC WinForms 2
Tags: GridControl
Atith Pagdi
Asked On September 19, 2005 10:15 AM UTC

Hi, In the PrepareViewStyleInfo event of the GridDataBoundGrid, I''m setting the e.Style.Text property for certain header columns: e.Style.Text = "Target"; For some of these columns, I want the header text to align to the right. For this I tried the following: e.Style.Text = "Target"; e.Style.TextAlign = GridTextAlign.Right; But this doesn''t seem to work. I also tried setting the CellValueType to typeof(System.Int16) but it still didn''t work. Could someone tell me why this is happening and how I can achieve the right alignment of a text field in the header? By default the text columns are center aligned in the header and left aligned in the data fields, whereas for numeric columns, the data is right aligned by default, but the header text, which I''m programmatically setting is center aligned. I want this to be right aligned as well. Thanks, Atith

Administrator [Syncfusion]
Replied On September 19, 2005 11:09 AM UTC

Hi Atith, Try this instead of TextAlign e.Style.Text = "Target"; e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; Best regards, Stanley

Atith Pagdi
Replied On September 20, 2005 08:43 AM UTC

That worked! Thanks, Atith


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon