A
Andy Wang
I need change HeaderText of DataGrid in PreRender(). But it seems
doesn't work.
The code example like this:
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
grdPortals.Columns(1).HeaderText = "Title"
End Sub
I can see the value changed correctly when I was in debug mode, but it
doesn't show on the page. It always the original value.
When I try to change the same HeaderText of DataGrid, it works fine.
The code is below,
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
grdPortals.Columns(1).HeaderText = "Title"
End Sub
Does this means the HeaderText of DataGrid can only be changed in
Page_Load()? And cannot be changed in PreRender()? Is there any way to
change it in PreRender()?
Thanks,
Andy
doesn't work.
The code example like this:
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
grdPortals.Columns(1).HeaderText = "Title"
End Sub
I can see the value changed correctly when I was in debug mode, but it
doesn't show on the page. It always the original value.
When I try to change the same HeaderText of DataGrid, it works fine.
The code is below,
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
grdPortals.Columns(1).HeaderText = "Title"
End Sub
Does this means the HeaderText of DataGrid can only be changed in
Page_Load()? And cannot be changed in PreRender()? Is there any way to
change it in PreRender()?
Thanks,
Andy