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

Decimal alignment

3 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andy H
Top achievements
Rank 1
Andy H asked on 23 Sep 2011, 12:45 PM
We are displaying result sets where the values have a varying number of decimal values, which we would like to display decimal aligned.

One could format the values to always display the same number of decimals (say ToString("0.0000")), but the values 0.1111 and 0.888 would still not be 100% correctly aligned unless a monospaced font is used. Not ideal.

Any other ideas?

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 23 Sep 2011, 01:01 PM
Hi Andy H,

Maybe this special column can help?

All the best,
Ross
the Telerik team

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

0
Andy H
Top achievements
Rank 1
answered on 26 Sep 2011, 02:30 PM
I was actually looking for something that will allow met to align values similar to the insignificant decimal place-holder ("?") in Excel. Please see attached.

Alternatively, would it be possible to write a custom formatter. Preferably the formatter should be executed after the grid has loaded so that one can apply the spacing depending on the maximum number of decimal places.
0
Rossen Hristov
Telerik team
answered on 27 Sep 2011, 07:17 AM
Hi Andy H,

By using a custom cell template and/or custom cell edit template, you can provide any kind of cell content that you like. The implementation would be up to you in this case.

All the best,
Ross
the Telerik team

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

Tags
GridView
Asked by
Andy H
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Andy H
Top achievements
Rank 1
Share this question
or