Adding Image to Template Column

  • Thread starter Sparky Arbuckle
  • Start date
S

Sparky Arbuckle

Does anyone know of a way to add an image into a DataGrid's Template
Column? Any suggestions are greatly appreciated.
 
S

Sparky Arbuckle

<asp:TemplateColumn HeaderText="Sample">
<ItemTemplate>
<asp:HyperLink id="Sample" runat="server" text="Listen"
NavigateURL='<%# Container.DataItem("SampleURL") %>' />
</ItemTemplate>
</asp:TemplateColumn>

I would like the image right next to the "Sample" HeaderText so that
the Header looks like:

Sample [image]

The image is a music note that is not in the database.
 
M

Matt Berther

Hello Sparky,

Can you do this?

<asp:Hyperlink allOfYourExistingAttributes><asp:Image id="myImage" runat="server"
ImageUrl="~/path/to/the/image"></asp:Hyperlink>
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top