By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,276 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,276 IT Pros & Developers. It's quick & easy.

change HeaderText of DataGrid in PreRender()

P: n/a
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
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.