tags:

views:

111

answers:

2

Using .net 2.0 .

I want to display a column in a DataGridView as a percentage value, but without the percent sign.

example :

1) say data in data source is 0.1234

2) using a DataGridView column format string of "P2" makes the grid show this value as "12.34 %". What I want to see is : "12.34", i.e. the original value multiplied by 100, but without the percent sign.

I can work around this by using a calculated column with an expression to multiply by 100, but does the Grid provide an easier way ? Assume the grid is used in read-only mode.

Thanks.

A: 

Try the column format N2 instead. You may need to multiply by 100 to get what you want however (as you've indicated)...

David Andres
You mean multiply by 100, right?
Matthew Scharley
edited with your correction
David Andres
+1  A: 

You could check out this SO post for ways of doing this, though you'll see that the answer to your question is no, there is not a built-in way of doing this.

patmortech
Thanks for the link. I ended up adding a calculated column instead.
Moe Sisko