更改使用HTML或C#中的GridView列名 [英] Changing the column name in GridView using HTML or C#

查看:393
本文介绍了更改使用HTML或C#中的GridView列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关键是我已经在我的项目中使用 GridView控件
我已经分配的值,以使用的GridView SQLConn 的SqlDataAdapter 的DataSet

The point is I have used GridView in my project. And I have assigned the Values to GridView using the SQLConn, SQlDataAdapter and DataSet

GridView1.DataSource=ds;
GridView1.DataBind();

的意思是说,输出显示表的列名称是不友好的最终用户。

The point is that the output shows the column name of the tables which is unfriendly for end users.

我怎样才能改变呢?

推荐答案

使用的GridView的自己列,可以指定在GridView的标题文字。转到GridView控件的属性 - >列 - >添加列,设置数据绑定到数据库列名和标题文本属性。

Use your own column of GridView and can assign the Header text of the gridview. Go to Properties of the GridView-->Columns-->Add the column and set the DataBound to the DB Column name and Header Text Property.

不要忘记给AutoGeneratedColumns属性设置为false在GridView的

And Dont forget to set the AutoGeneratedColumns property to false of the gridview

这篇关于更改使用HTML或C#中的GridView列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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