473,385 Members | 1,942 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,385 software developers and data experts.

setting column headertext to a variable?

I have an ASP.NET datagrid with several bound columns. I need to make the
header of some of these columns display a string that is generated from the
code behind (i.e. a dynamic header). How is this done?

I have tried with both a templatecolumn and boundcolumn. I thought it might
be something like: HeaderText='<%# DataBinder.Eval(Container,
"DataItem.myVariable") %>' or HeaderText='<% Response.Write(myVariable); %>
But, neither worked, nor did several variations. I just want the headertext
to display myVariable which is declared as a string. Can anyone please
assist?

TIA,
John

(x-post: microsoft.public.dotnet.framework.aspnet)
Nov 16 '05 #1
0 941

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

Similar topics

0
by: amber | last post by:
Okay, there is some wierdness going on with my datagrid... I'm trying to make my column header 2 lines high. If I go into the Form - InitializeComponent code, and change the line: ...
2
by: Tim Nelson | last post by:
I thought there should be simple way of setting the column width in the a DataGrid. I've set up a table style (properties tab) that lengthen the columns, but I can't seem to bind this table style...
1
by: VB Programmer | last post by:
I have a datagrid which is bound to a datatable that I create on the fly. How do I set the width of each column via code? Ex: Column 1 is always 100, Column 2 is always 250, etc... Thanks!
17
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5...
2
by: Ron L | last post by:
I am attempting to set up a datagrid that will 1) display a subset of data from a SQL Stored Procedure in a different order form how SQL returns it, and 2) display 3 of the columns using pulldowns....
2
by: Charleees | last post by:
Hi all, I have a DataGrid with Template Columns..... There are LAbels,Linkbuttons in the Single Row.. I have to set the Constant Column width for those Template Columns in Grid... Wat...
0
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from...
10
by: TF | last post by:
Very newbie question and I hope this is the right group. I have a table on a web page which contains info about paint colors. One column contains the hex value for the color's RGB value. I want...
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.