On Mon, 14 Jun 2004 15:23:10 -0700, Alek Davis
<alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote:
Forgot to mention: I generate the image tag (with a hyperlink)
dynamically
using a function in code behind. So I was looking to an option like this:
<ASP:TEMPLATECOLUMN
HeaderText='Info <%= GetHelpIconHtml("HelpTopicID") %>'>
The goal would be to produce HTML like this:
<TD...>Info <A Href=...><IMG Src=...></A></TD>
where <A Href.../A> is generated by the GetHelpIconHtml function in
code-behind.
Alek
As you see, the DataColumn has a HeaderText property:
http://msdn.microsoft.com/library/en...rTextTopic.asp
it may be easier to do this in the code-behind than in the aspx binding
statement, even tho what you have looks OK as well. But you should be
able to use HTML like <img src=""...> in the HeaderText and it'll render
to an image when displayed. If you want to do it in the code-behind,
there is an ItemCreated event on the datagrid you can use in code-behind
and check e.Item.ItemType and if it's a header item type, you could set
the images then by adding controls to the e.Item.Cells. Or after binding,
you could go back and loop thru the cols and do it then (setting
col.HeaderText).
Here's a slightly different example, where the guy is setting his own
images in the header when sorting:
http://msdn.microsoft.com/library/en...rTextTopic.asp
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET