DataGrid

  • Thread starter Thread starter vinay
  • Start date Start date
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
 
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
 
I tried it, it gives me error while binding.
Exception Details: System.FormatException: Format
specifier was invalid.

Thx
vinay
 
{0:D2} is the example straight out of the Visual Studio.NET Help file. Are
you sure you typed it in correctly?
 
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?






.
 
Back
Top