473,324 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Programmatically set headertext of a boundfield column

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 ***
Aug 20 '06 #1
0 1489

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: fuchs.markus | last post by:
Hello, on my page, I have a DetailsViewControl connected to a SqlDataSource. Now when I dynamically set the FilterExpression and FilterParameters - for example in a OnClick-EventHandler of a...
0
by: sloan | last post by:
When defining a GridView column...and the header for that column <asp:BoundField DataField="Price" HeaderText="The Price" SortExpression="Price" /> is there a way to force a <br/> in the...
1
by: Mark Stafford | last post by:
I am attempting to use a DetailsView control to view some data where the fields returned by the database are determined at runtime. I create the TemplateFields on the fly using a class that...
2
by: Wayne Deleer | last post by:
Hi All, I'm currently working on a project, and I've come to a part where I want to add data to a GridView. BUT, I want to do it programmatically, with alot of control over everything. In my...
0
by: cook.jonathan.m | last post by:
I want to programmatically add a dropdown to each row in a certain column returned to the gridview by my query. I want to do this entirely in behind-code. My gridview tag in the page will have...
1
by: michel | last post by:
Hi, I want to add programmatically a boundfield to a gridview: <asp:GridView ID="GridView1" runat="server"> <Columns> </Columns> ..... </asp:GridView>
4
by: Tomasz | last post by:
Hello Developers, Here is interesting problem I just came across: how do I wire a GridView control programmatically? Here is my sample code using Object Data Source: protected void...
5
by: NKaufman | last post by:
<asp:GridView ID="Basic" runat="server" DataKeyNames="QuestionID,isHeading" AutoGenerateColumns="false" AllowPaging="true" PageSize="100"> <Columns> <asp:BoundField Visible="false"...
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am trying to embed HTML in a gridview's HeaderText field. Something like this: <asp:BoundField DataField="rfq_4567_count" HeaderText="RFQs<br>(4-5-6-7)" SortExpression="rfq_4567_count"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.