数据网格 [英] DataGrid

查看:148
本文介绍了数据网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我将数据集绑定到DataGrid。


我有一个返回小数值的字段。


Ex:0.23


在dataGrid中,它只显示0为0.23的内容!


如何格式化得到小数值?


谢谢

vinay

解决方案

在DataGrid控件的Property Builder中,选择正确的Bound

列,然后在数据格式化表达式中选择。 box add{0:D2}。


有关格式化数据的更多信息,请搜索DataFormatString

属性。

lds


" vinay" < 6 ********* @ corpusinc.com>在消息中写道

news:08 **************************** @ phx.gbl ... < blockquote class =post_quotes>

我正在将数据集绑定到DataGrid。

我有一个返回小数值的字段。

例:0.23

在dataGrid中它只显示0.2的0.23!

如何格式化它以获得小数值?

谢谢
vinay



我试了一下,它在绑定时给我错误。

异常细节:System.FormatException:格式

说明符无效。


Thx

vinay

-----原帖-----
在DataGrid控件的Property Builder中,选择
正确的BoundColumn,然后在数据格式化表达式中选择box
add" {0:D2}。
有关格式化数据的更多信息,请搜索
DataFormatStringProperty。
lds

vinay ; < 6 ********* @ corpusinc.com>在消息中写道
新闻:08 **************************** @ phx.gbl ...



我正在将数据集绑定到DataGrid。

我有一个返回小数值的字段。

Ex:0.23

在dataGrid中它只显示0个0.23的内容!

如何格式化它以获得小数值?

谢谢
vinay





{0:D2}直接来自Visual Studio.NET帮助文件。

你确定你输入的正确吗?


" vinay" < 6 ********* @ corpusinc.com>在消息中写道

news:01 **************************** @ phx.gbl ... < blockquote class =post_quotes>我试过了,它在绑定时给了我错误。
异常细节:System.FormatException:格式
说明符无效。

Thx vinay

-----原始消息-----
在DataGrid控件的Property Builder中,选择


正确的Bound

列,然后在数据格式表达式中。框


添加{0:D2}。


有关格式化数据的更多信息,请搜索


DataFormatString < blockquote class =post_quotes> Property。
lds

" vinay" < 6 ********* @ corpusinc.com>在消息中写道
新闻:08 **************************** @ phx.gbl ...



我正在将数据集绑定到DataGrid。

我有一个返回小数值的字段。

Ex:0.23

在dataGrid中它只显示0个0.23的内容!

如何格式化它以获得小数值?

谢谢
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

"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



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


.



{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


.



这篇关于数据网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆