生成数据网格视图列 [英] Fromating data grid view column

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

问题描述

嗨..是否有可能仅设置百分比格式的数据网格视图列?

Hi.. Whether its possible to format a data grid view column for entering percentage only??

推荐答案

是!

试试:
Yes!

Try:
DataGridTextBoxColumn aCol4 = new DataGridTextBoxColumn();
aCol4.MappingName = "Percentage";
aCol4.HeaderText = "Percent";
aCol4.Width = 50;
aCol4.Alignment = HorizontalAlignment.Right;
aCol4.NullText = "0";
aCol4.TextBox.Enabled = true; 
aCol4.Format = "{0:P}%";


但不起作用.是否需要设置其他属性?
but its not working.need to set any other property?


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

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