By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,435 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,435 IT Pros & Developers. It's quick & easy.

DataGrid

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

"vinay" <vi*********@corpusinc.com> wrote in message
news:08****************************@phx.gbl...
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

Nov 17 '05 #2

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

Thx
vinay
-----Original Message-----
In the Property Builder of the DataGrid control, select the correct BoundColumn, then in the "Data formatting expression" box add "{0:D2}.
For more information on formatting data, search on the DataFormatStringProperty.
lds

"vinay" <vi*********@corpusinc.com> wrote in message
news:08****************************@phx.gbl...
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

.

Nov 17 '05 #3

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

"vinay" <vi*********@corpusinc.com> wrote in message
news:01****************************@phx.gbl...
I tried it, it gives me error while binding.
Exception Details: System.FormatException: Format
specifier was invalid.

Thx
vinay
-----Original Message-----
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

"vinay" <vi*********@corpusinc.com> wrote in message
news:08****************************@phx.gbl...
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

.

Nov 17 '05 #4

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

"vinay" <vi*********@corpusinc.com> wrote in message
news:01****************************@phx.gbl...
I tried it, it gives me error while binding.
Exception Details: System.FormatException: Format
specifier was invalid.

Thx
vinay
>-----Original Message-----
>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
>
>
>
>"vinay" <vi*********@corpusinc.com> wrote in message
>news:08****************************@phx.gbl...
>> 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
>
>
>.
>

.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.