Display Images In a datagrid

J

John Do

Hi,
I want to store the path and the name of the images in a
sql 2000 database and all the images in a folder named
images. And then I want to display all the images in a
datagrid. Does any one know how to do it?
Thanks in advance
Jonh
 
S

Suresh

Manually bind the columns to your datagrid. Set
autogeneratecolumns property to false. Then put this among
your DataGrid columns.

<ASP:TEMPLATECOLUMN HEADERTEXT="Signature">
<ITEMTEMPLATE>
<ASP:IMAGE Height="35" Width="180" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "YourImageLocation") %
 
P

Pooran Prasad

Hi John,
It is simple. Get the dataset with say Id, Display Name
and Image Name. In the datagrid, make 2 templates, say one
for Id and the other to display image with display name as
alternate text.
In the second template use something like this
<asp:TemplateColumn >
....
<ItemTemplate>
<img src='images/<%#
DataBinder.Eval(Container.DataItem,"ImageName")%>' alt='<%#
DataBinder.Eval(Container.DataItem,"DisplayName")%>' border=0 >
</ItemTemplate>
....
</asp:TemplateColumn>
Hope that helps
Have a great day:)
R. Pooran Prasad
Itreya Technologies Pvt Ltd.,
Mail: (e-mail address removed)
Phone(Off) : 5200179/80/81/82/83 Extn: 42
Mobile: +91 98860 29578
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top