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?






.
 

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

Similar Threads


Back
Top