473,396 Members | 2,020 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,396 software developers and data experts.

Adding Image to Template Column

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

Nov 19 '05 #1
4 1983
<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.

Nov 19 '05 #2
So is this not possible?

Nov 19 '05 #3
Sparky i also asked a similar Question:)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4
Hello Sparky,

Can you do this?

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

--
Matt Berther
http://www.mattberther.com
<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.


Nov 19 '05 #5

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

Similar topics

1
by: The_Rave | last post by:
Hi everyone, I'm trying to add my own template columns to the property builder of ..NET. E.g. a checkbox column, or an image column. But I can't find the sources of the wizard, or a way to add...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
0
by: Michelle Stone | last post by:
i am puzzled. i have previously bound datasets to datagrids which contain the filename of IMAGES. And i use template columns to show the image for each row. But now it is not working. I have reviewed...
3
by: Simon Harris | last post by:
Hi All, I have a data grid which displays country names. I now wish to display the country flag images above the names. Can someone please advise how I display an image in a datagrid? I have a...
1
by: RN | last post by:
Hi. I used this article to add a template column to a datagrid that is entirely created with code: ...
1
by: Shapper | last post by:
Hello, How to create a Template Column with an Image in a datagrid from my VB code? Thanks, Miguel
1
by: Abhishek | last post by:
I am creating a Datagrid at runtime and I have to create all the columns of grid at runtime... I am facing problem in the item template column. Here I want to place more than one control... For...
2
by: Beemer Biker | last post by:
I have a 10 row (per page) gridview where the first column is a small image under 100x200px and the second column is a DropDownList template that selects which image to show in the first column. ...
7
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.