日期:2014-05-19  浏览次数:20921 次

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.