首页 > 慧问 > 频道

C1FlexGrid格式化显示

发表于2019-05-10 回复:0 查看:1398  |  
<pre class='brush: csharp'>tyC1FlexGrid1.AllowEditing = true; this.tyC1FlexGrid1.Cols.Count = 2; this.tyC1FlexGrid1.Cols[1].DataType = typeof(System.Decimal); this.tyC1FlexGrid1.Cols[1].Format = "P2";</pre> 以上代码在单元格数据数字0.23,结束编辑后显示为23.00%。如果使用DataSource绑定了DataTable后就不能显示了 <pre class='brush: csharp'>DataTable dt = new DataTable(); DataColumn dc = new DataColumn("Title", typeof(System.Decimal)); dt.Columns.Add(dc); Decimal d = new Decimal(0.43); dt.Rows.Add(new Object[] { d }); this.tyC1FlexGrid1.DataSource = dt;</pre> 不知道有什么办法解决这个问题?
0个回答

打破零回复...

回复

登录 慧都网发表评论

扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP