Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Programmatically set headertext of a boundfield column

Reply
Thread Tools

Programmatically set headertext of a boundfield column

 
 
John Mason
Guest
Posts: n/a
 
      08-20-2006
Hi,

I am trying to find out if there is a way to set the headertext of the
boundfield column belonging to a detailsview control (ASP.NET 2.0), from
code.

<asp:BoundField HtmlEncode="false" DataFormatString="{0:###0.00}"
DataField="wage_cash" HeaderText='<%# Format_Header("wage1") %>'
SortExpression="wage_cash" />

The above example doesn't work:
"Databinding expressions are only supported on objects that have a
DataBinding event."

I would like to set the headertext within the DetailsView_PreRender sub,
so that the header displays the current financial year.

I'd prefer not to convert the above to a TemplateField column, because
of the formatting used - DataFormatString="{0:###0.00}"

Any help (with vb.net examples) would be especially appreciated!

Thanks,

John.



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add programmatically a boundfield to a gridview? michel ASP .Net 1 02-17-2007 04:52 PM
Programmatically set template column column header value jdhavo@yahoo.com ASP .Net Datagrid Control 2 08-19-2006 04:17 AM
How do I change the headertext of a datagrid column programmatically Ravi Gudlavalleti ASP .Net Datagrid Control 1 06-17-2004 11:48 PM
Set Column Headertext =?Utf-8?B?QWxlc3NhbmRybyBSb3NzaQ==?= ASP .Net 1 02-27-2004 02:13 PM
Column HeaderText set at runtime? Mark A Gregory ASP .Net Datagrid Control 0 07-19-2003 11:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57