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

Problem of alignment

1 Answer 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fabien
Top achievements
Rank 2
Fabien asked on 24 Apr 2009, 10:08 AM
Hi,
I use Q1 2009 SP1.

I tried to set my column like this

            // Percent 
            GridViewDecimalColumn Percent_Column = new GridViewDecimalColumn("Percent""Percent"
            { 
                HeaderText = "Percent"
                HeaderTextAlignment = ContentAlignment.MiddleCenter, 
                FormatString = "{0:N1} %"
                DataType = typeof(decimal), 
                TextAlignment = ContentAlignment.MiddleRight, 
                DecimalPlaces = 1, 
                ThousandsSeparator = true
                WrapText = false
                ShowUpDownButtons = false
                StretchVertically = false 
            }; 
            pRadGridView.MasterGridViewTemplate.Columns.Add(Percent_Column); 

Or like this

            // Percent 
            GridViewDecimalColumn Percent_Column = new GridViewDecimalColumn("Percent""Percent"
            { 
                HeaderText = "Percent"
                HeaderTextAlignment = ContentAlignment.MiddleCenter, 
                FormatString = "{0:N1} %"
                DataType = typeof(decimal), 
                TextAlignment = ContentAlignment.MiddleRight, 
                DecimalPlaces = 1, 
                ThousandsSeparator = true 
            }; 
            pRadGridView.MasterGridViewTemplate.Columns.Add(Percent_Column); 

But each time, my text in the cell is on the left. what happend?

Best regards,

Fabien


1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 24 Apr 2009, 03:14 PM
Hello Fabien,

I tested the code and it worked OK. The text is aligned to the right as expected. Maybe there is some additional code in your application that intervenes with this functionality. Please open a support ticket and send me a sample application that reproduces the issue. I will be glad to help you further.
 

Regards,
Jack
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
GridView
Asked by
Fabien
Top achievements
Rank 2
Answers by
Jack
Telerik team
Share this question
or