Adding Image to Template Column

  • Thread starter Thread starter Sparky Arbuckle
  • Start date 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.
 
<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.
 
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

Back
Top