Can I set HeaderText on the fly?

V

VB Programmer

Here's the columns in my dg:
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="Area Manager">
<HeaderStyle Width="200px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Date1" HeaderText="<%#
SetColumnHeader(1) #%>">
</asp:BoundColumn>
<asp:BoundColumn DataField="Date2"
HeaderText="MyDate2"></asp:BoundColumn>
<asp:BoundColumn DataField="Date3"
HeaderText="MyDate3"></asp:BoundColumn>
<asp:BoundColumn DataField="Date4"
HeaderText="MyDate4"></asp:BoundColumn>
<asp:BoundColumn DataField="Date5"
HeaderText="MyDate5"></asp:BoundColumn>
</Columns>

I wanted to set Date1-5 on the fly. In the first column I tried to call a
function to get it. Is this the best way to do it?

I'm getting this error:
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30676: 'DataBinding' is not an event of
'System.Web.UI.WebControls.BoundColumn'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top