473,657 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

image on a datagrid

Tom
Hey all,
have a dategrd and am storing a url to an image in it. I
have no idea how to show the actual image. Can anyone give
me a hand or point me towards an example they know of. I
have searched the web and haven't found anything that is
of much use. Cheers and have a good one,
Tom
Jul 19 '05 #1
1 2613
tom
figured it out myself if anyone is interested:

Private Sub dgName_ItemData Bound(ByVal sender As
Object, ByVal e As
System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles
dgName.ItemData Bound
'will be used to set the value of the image in the
datagrid
Dim imgTest As New System.Web.UI.W ebControls.Imag e
()

If e.Item.ItemType = ListItemType.It em _
Or e.Item.ItemType = ListItemType.Al ternatingItem
Then
'we have hard coded the text "No image
available" earlier on. And look for it here.
'if that is the text then out put it, if not,
out put the picture
imgTest.ImageUr l = e.Item.Cells(5) .Text
If imgTest.ImageUr l = "No image available" Then
e.Item.Cells(5) .Text() = imgTest.ImageUr l
Else
e.Item.Cells(5) .Controls.Add(i mgTest)
End If
End If
End Sub

thanks anyway,
tom
-----Original Message-----
Hey all,
have a dategrd and am storing a url to an image in it. I
have no idea how to show the actual image. Can anyone giveme a hand or point me towards an example they know of. I
have searched the web and haven't found anything that is
of much use. Cheers and have a good one,
Tom
.

Jul 19 '05 #2

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

Similar topics

21
3065
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do it using DirectX. I downloaded already the DSK etc, but I can't find how I need to draw an image on a given position. I don't need stuff to write advanced 3D-games, just painting that image. Can anybody help me with this? I'm already looking for...
1
2258
by: Jim Hammond | last post by:
The code below implements two datagrid columns that display images. The first column is just a test that always displays the same image directly from a file. The second column pulls the image from the dataset. The datagrid contains several additional columns that are not seen here because they are automatically generated and bound to the dataset. All columns work except the second image column, which attempts to bind to the dataset. When...
1
2497
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks- John
4
1446
by: nicholas | last post by:
How can I show or hide an image in a datagrid depending on a field. Something like: if myfield <> "" then 'show image' else 'show noimage.gif' end if the image field contains the image name so: 'show image' could be something like <img source="/myfolder<%# databinder.eval(....) %>" ..... > THX
2
1827
by: SQL_Klovn | last post by:
Hi! I have been struggeling for quite some time now with a stupid problem which drives me crazy. I have Datagrid, where I load some images from a SQL2000 database. This works fine, but I am not abel to make the image in the datagrid to be a link to another page. I have created a Templeate Column for this. Could someone be kind enough to point me in the right direction?
13
2345
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't reached yet (I have gone all the way to page 50 on Google's results!!). Here are my requirements: • I have a DataGrid. Everything will be done from here. Everything. No exceptions. Everything will also be done in VB, without any code-behind to...
1
2213
by: ltt19 | last post by:
Hi everyone! I want to do da Image gallery using just the datagrid, this one will dilpays only images, no text, that means that it will have about 4 Collumns that will displays just images from the same database table, from the same collumn of the table. However I could not reproduce this, since each Row (with 4 collumns) displays 4 times the same image. How can i fix it? here is a part of the code:
0
1228
by: Tim::.. | last post by:
Please, please, please help!!! I have a datagrid that displays a list of contacts on our intranet site using the ActiveDirectory as it's main Data Source. I want to be able to show an image of each employee using a popup layer but am not sure how I match the Active Directory Data to the correct image stored in an SQL database. I plan on using the users fullname or email address as an identifier to match up the image with the correct...
1
2268
by: Michael Turner | last post by:
Anyone know if you can add a background image to a datagrid, there is a property for colour but not for an image.
0
1401
by: rockdale | last post by:
Hi, All: I dynamic add an arrow up/down image in OnItemDataBound event for my datagrid, it works fine. But I have another textbox which trigger postback and doing something, after this event get executed, I lost the image but the datagrid maintain the same sort order. Should the datagrid remain what it looks like (with the riget arrow up/down image) before the postback caused by the textbox?
0
8323
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.