This is a migrated thread and some comments may be shown as answers.

Horizontal align column headers

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 04 Mar 2009, 03:46 PM
Hi

I am successfully header properties in the code behind using this code ...
If e.Column.UniqueName = "Format" Then  
            e.Column.HeaderText = "Size" 
            e.Column.HeaderStyle.Width = Unit.Pixel(60)  
            e.Column.ItemStyle.HorizontalAlign = HorizontalAlign.Right  
        End If 
EXCEPT for the horizontal align which is ignored in favour of the default left align .
I see there was a comment that this was fixed in Jan 2008 but it still does not seem to work
correctly?.

I am using 2008.3 download 11 december 2008.

Has there been a fix in a subsequent release? Is there some other way to do it?
Some column headers are still left aligned so a blanket setting does not work.

Thanks

Clive

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Mar 2009, 04:32 PM
Hello Clive,

Test the following approach and let me know whether it behaves as expected:
Protected Sub RadGrid1_PreRender(sender As Object, e As EventArgs) 
    RadGrid1.MasterTableView.GetColumn("myColumnName").HeaderStyle.HorizontalAlign = HorizontalAlign.Right 
End Sub 

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or