Align text in header of GDBG

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

2 Replies

AD Administrator Syncfusion Team 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


AP Atith Pagdi September 20, 2005 08:43 AM UTC

That worked! Thanks, Atith

Loader.
Up arrow icon