GridView的标题文本在asp.net [英] GridView Header Text in asp.net
本文介绍了GridView的标题文本在asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿,伙计们,
我想用设计在GridView ..的标题文本从更改<的TemplateField的HeaderText =>
我创建了code变量的背后是公众和变量设定的值,然后我试图打电话给该变量在这里如下:
i created a variable in code behind which is public and set the value in that variable and then i tried to call that variable over here as below:
<TemplateField HeaderText = '<%= VariableCallHere %>'
但在运行网页的情况下,我得到&LT;%= VariableCallHere%>作为标题文本
即使我试图用改变 gridView1.HeaderRow.Cells [0]。文本=TEXT这里
(此抛出对象引用错误)
but while running page i got <%= VariableCallHere %> as a header text
even i tried changing using gridView1.HeaderRow.Cells[0].Text = "text Here"
(This Throws object reference error)
任何一个有任何建议,如何才能实现。
Any one have any suggestions how this could be achieved..
推荐答案
这应该是 gridview1.Columns [参数:columnIndex] .HeaderText =标题文本;
这篇关于GridView的标题文本在asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文