更改 RadGrid 列标题
我尝试在 PreRender 事件中使用以下代码片段来更改 HeaderText 但它不起作用。 实际上,我只是注意到 RadGrid1.columns 是空的(带有断点),但我的 RadGrid 有 3 列:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
foreach (GridColumn col in RadGrid1.Columns)
{
if (col.UniqueName == "idAgir")
col.HeaderText = "Numéro";
if (col.UniqueName == "objet")
col.HeaderText = "Titre du Ticket";
if (col.UniqueName == "dateEtatIncident")
col.HeaderText = "Date dernière intervention";
}
RadGrid1.Rebind();
}
I tried to use the following code snippet in the PreRender event to change the HeaderText but it is not working.
Actually, I just noticed RadGrid1.columns
was empty (with a break point) but my RadGrid has 3 columns:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
foreach (GridColumn col in RadGrid1.Columns)
{
if (col.UniqueName == "idAgir")
col.HeaderText = "Numéro";
if (col.UniqueName == "objet")
col.HeaderText = "Titre du Ticket";
if (col.UniqueName == "dateEtatIncident")
col.HeaderText = "Date dernière intervention";
}
RadGrid1.Rebind();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 MasterTableView,您的方法将会起作用
Your way will work if you'll be using MasterTableView