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

Header Positioning

3 Answers 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 30 Jan 2008, 03:35 PM
Your text alignment does not work.  If you set the text alignment for a GridViewDecimalColumn to MiddleRight, and set the HeaderTextAlignment to MiddleCenter, when you run the Grid both of them are shown as MiddleRight, the column data and the Header.

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 31 Jan 2008, 06:15 PM
Hi Leonard,

Thank you for reporting this issue - we managed to reproduce it locally. We will address the problem in our Q1 2008 release (due in April). In case you prefer to have a fix sooner, please write back and we will see whether we will be able to provide you with a build sooner.

Please, excuse us for the inconvenience. Your Telerik points have been updated.

 
Kind regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Tim
Top achievements
Rank 1
answered on 31 Jan 2008, 09:33 PM
Thanks Jack for the heads up.  Is there any way possible that I can get an update before April please.  I am doing an actual deployment of this particular application February 8, 2008.  Please let me know...  Thanks.
0
Jack
Telerik team
answered on 01 Feb 2008, 02:19 PM
Hello again Leonard,

I am glad to inform you that after some digging I found a solution for your issue. You can use the CellFormatting event and change the text alignment manually through code. The following code sample demonstrates this approach:

this.radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting); 
((GridViewDataColumn)this.radGridView1.Columns["Value"]).TextAlignment = ContentAlignment.MiddleRight; 
this.radGridView1.Columns["Value"].HeaderTextAlignment = ContentAlignment.MiddleCenter; 
this.radGridView1.GridElement.Update(false); 
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) 
    if (e.CellElement is GridHeaderCellElement) 
    { 
        if (((GridViewDataColumn)e.CellElement.ColumnInfo).DataField == "Value"
        { 
            e.CellElement.TextAlignment = ContentAlignment.MiddleCenter; 
        } 
    } 
 

In case you need further assistance, do not hesitate to contact us.

 
Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Jack
Telerik team
Tim
Top achievements
Rank 1
Share this question
or