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

Dynamic Text Alignment

2 Answers 201 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mariusz
Top achievements
Rank 1
Mariusz asked on 12 Jul 2012, 09:11 AM
How to dynamic align text in columns, depends on column types. Eg. columns with numeric values should be alignment to right, with data to center, with text to left.
Columns are autogenerated.

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 12 Jul 2012, 09:16 AM
Hello,

 You could use a CellStyleSelector and return a style based on the column type.

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Dimitrina
Telerik team
answered on 12 Jul 2012, 09:28 AM
Hello,

 Actually you could do that even simpler. Just subscribe for the AutoGeneratingColumn event of the RadGridView and set the TextAlignment for the column currently being generated based on its data type.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Mariusz
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or