//修改gridview的HeaderText属性的方法
private void SetGridViewLanguage()
{
foreach (System.Web.UI.Control control in this.Controls)
{
if (control is GridView)
{
foreach (DataControlField field in control.Columns)
{
field.HeaderText = "aaa";
}
}
}
} protected void Page_Load(object sender, EventArgs e)
{
GridBind(base.EmployeeId);
SetGridViewLanguage(); //调用修改gridview的方法
}问题:页面第一次显示时gridview的HeaderText的属性并没有改变,要点一个按钮后才会变成aaa,要怎样才能在页面一开始gridview的HeaderText就显示为aaa呢
private void SetGridViewLanguage()
{
foreach (System.Web.UI.Control control in this.Controls)
{
if (control is GridView)
{
foreach (DataControlField field in control.Columns)
{
field.HeaderText = "aaa";
}
}
}
} protected void Page_Load(object sender, EventArgs e)
{
GridBind(base.EmployeeId);
SetGridViewLanguage(); //调用修改gridview的方法
}问题:页面第一次显示时gridview的HeaderText的属性并没有改变,要点一个按钮后才会变成aaa,要怎样才能在页面一开始gridview的HeaderText就显示为aaa呢
SetGridViewLanguage(); //调用修改gridview的方法
倒过来。或者在绑定一次吧
SetGridViewLanguage(); //调用修改gridview的方法
GridBind(base.EmployeeId);
-----
要不想其他办法刷新一下Gridview