all groups > visual studio .net general > june 2006 >
You're in the

visual studio .net general

group:

DetailsView: DataFormatString


DetailsView: DataFormatString Ed Warren
6/30/2006 6:40:06 AM
visual studio .net general:
I thought this was easy!!!

I have a DetailsView with a number field (integer) e.g. (8)
I want to display it as 000000008 (user requirement)

I have tried entering 000000000 into the DataFormatString I get 000000000
displayed.
I have tried various combinations of using single quotes, double quotes, no
quotes to no avail.

What do I enter to get the desired results?

DataFormatString:____________

Thanks Ed Warren.

Re: DetailsView: DataFormatString Ed Warren
7/6/2006 12:00:00 AM
Unfortunately no one was of help. Eventually I figured it out on my own.
Here is the answer for the next unfortunate lost soul:

{0:000000000}

The key is using the curly braces and the first and 0:, this tells the
formatting to insert the first (only) value into the 'mask'.

Also for a North American telephone number:
{0:(###) ###-####} works.

Ed Warren.

[quoted text, click to view]

AddThis Social Bookmark Button