首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

DataGridView列头的中文显示有关问题

2012-02-15 
DataGridView列头的中文显示问题数据库里的表的列名都是英文,例如Department表里有IDName等如何通过DataGr

DataGridView列头的中文显示问题
数据库里的表的列名都是英文,例如   Department表里有ID   Name   等
如何通过DataGridView显示成编号,名称呢?不能破坏数据库。

谢谢大家了~     给点思路!

[解决办法]
this.dataGridView1.Columns[ "ID_RULEGROUP "].Visible = false;
this.dataGridView1.Columns[ "no_RULEGROUP "].HeaderText = "角色群编号 ";
this.dataGridView1.Columns[ "nm_RULEGROUP "].HeaderText = "名称 ";

this.txtRuleGruopId.DataBindings.Add( "Text ", bindMaster, "id_rulegroup ");
this.txtRuleGroupNo.DataBindings.Add( "Text ", bindMaster, "no_rulegroup ");
this.txtRuleGroupName.DataBindings.Add( "Text ", bindMaster, "nm_rulegroup ");
[解决办法]

在DataGridView右键-> 编辑列-> HeadText,此处为列显示的内容,可以不同于Name.

热点排行