DataGrid

V

vinay

Hi,

I am binding a dataset to DataGrid.

I have a field which returns decimal values.

Ex: 0.23

In dataGrid it is showing only 0 insted of 0.23!

How to format it to get the decimal value??

Thanks
vinay
 
D

Duppypog

In the Property Builder of the DataGrid control, select the correct Bound
Column, then in the "Data formatting expression" box add "{0:D2}.

For more information on formatting data, search on the DataFormatString
Property.
lds
 
V

vinay

I tried it, it gives me error while binding.
Exception Details: System.FormatException: Format
specifier was invalid.

Thx
vinay
 
D

Duppypog

{0:D2} is the example straight out of the Visual Studio.NET Help file. Are
you sure you typed it in correctly?
 
V

vinay

This one worked for me
{0:0.00}
-----Original Message-----
{0:D2} is the example straight out of the Visual Studio.NET Help file. Are
you sure you typed it in correctly?






.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,100
Messages
2,570,635
Members
47,241
Latest member
HumbertoSt

Latest Threads

Top