add a DataGridTextBoxColumn and set its Format property to something like "0.00", see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridtextboxcolumnclassformattopic.aspCustom Numeric Format Strings Output Examples
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericformatstringsoutputexample.asp?frame=tru
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridtextboxcolumnclassformattopic.aspCustom Numeric Format Strings Output Examples
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericformatstringsoutputexample.asp?frame=tru
解决方案 »
- winform 启动过程详解多要实例化哪些东西?
- 页面加载成功,但进度条未加载完成
- 我需要得到一段时间的每天注册人数 应该怎么写sql语句
- C# 保存网一个网页为mht文件的问题?
- 怎样在窗体显示出来后自动执行一条语句或者一个事件。
- 用c#写的另存为execl文件时,报告Excel._Application QueryInterface 错误?
- 系统超时后自动返回到登陆页面如何实现?
- 谢谢
- 为什么当我调用了Socket.Close 后,客户端还是能够发信息给服务端?
- 怎样用c#在html页面里实现画图的功能?不是利用Graphics画图后生成jpg图像!
- Access设完密码后怎么连?
- dateGrid中的数据如何存成XML格式?
DataGridTextBoxColumn dgcstyle=new DataGridTextBoxColumn();
dgcstyle.FormatInfo = CultureInfo.CurrentCulture.NumberFormat;
dgcstyle.Format="C";
<HeaderStyle Width="48px"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:BoundColumn>主要是DataFormatString="{0:###,###,#0}
<asp:TemplateColumn HeaderText="已入<br>数量">
<ItemTemplate>
<asp:TextBox id=txt_qty runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "qty","{0:###,###.00}")%>' >
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
ts1.MappingName = "CardFunction";
ts1.RowHeaderWidth=33;
// 1
DataGridTextBoxColumn TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = "vipcard_sort";
TextCol.HeaderText = "卡别";
TextCol.Width = 105;
TextCol.NullText="";
TextCol.Format="0.00";