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

format a number based on its length

1 Answer 124 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pete Haberstroh
Top achievements
Rank 1
Pete Haberstroh asked on 24 Apr 2009, 02:26 PM
I created a report in Q3, and reading a number in from a field, what I would like to do is format the number like this

if the number is > then 8 digits, format it like this ### ### ###

if it is <= 8 digits format it like this #### ####

how would I do this, I am new to all of this and still learning please guide me in the right direction, or maybe a video or certain page in the manual would be great.

thanks in advance

Pete

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Apr 2009, 10:47 AM
Hi Pete,

Normally you would do such a thing using the Format property of the textbox item. However if you need to change the formatting dynamically based on something, you can wire up the ItemDataBound event of the textbox item, where the value is available and set the formatting according to the value's length.

Kind regards,
Steve
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
General Discussions
Asked by
Pete Haberstroh
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or