473,729 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

image in template column in datagrid

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 the code for over two days and I am still stuck. Here is the template column as it is in the datagrid now

<asp:TemplateCo lumn HeaderText="Sta tus"><ItemTempl ate><asp:Image id=Image4 runat="server" ImageUrl='<%# gridGetImagePat h (DataBinder.Eva l(Container, "DataItem.nStat us").ToString ()) %>'></asp:Image></ItemTemplate></asp:TemplateCol umn

the gridGetImagePat h is a function that returns a string representing the filename of the image to display. I used debugging techniques in visual studio and discovered that control doesn't even ENTER that function!

here is the code that displays the grid through code

approvalPending PoliciesSet.Cle ar ()
sqlApprovalPend ingPoliciesData Adapter.Fill (approvalPendin gPoliciesSet)

approvalGrid.Da taSource = approvalPending PoliciesSet
approvalGrid.Da taMember = "TPolicy"
approvalGrid.Da taKeyField = "IDPolicy"

// Set up column
approvalGrid.Da taBind ()

Of course, except for the template column given above and some others, other columns are generated through code which i have not shown above. All other columns appear normally. This is the only column that doesn't show the image

To make things MORE CONFUSING, i tried putting ORDINARY Labels (with no databinding). NOTHING I put in that template column comes on the screen. Something fishy upon that column? :-

Help! Thanks :

Michell

Nov 18 '05 #1
0 1122

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

Similar topics

2
2627
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four columns. Three are databound to a dataset and one is a template column. I need to be able to access each item in the template column (getting access to the hyperlink) then adding an attribute to call some client side code. Does anyone know...
1
1306
by: William Gower | last post by:
I need to develop a datagrid that uses columns from a table. In addition I need two columns (checkboxes) that the user will use to indicate that this record can be closed later. The checkboxed column is not a field in the table. It is just for the purposes of the Datagrid and I do not need to store whether it was checked or not. Do I use a Template Column for this?
3
2743
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 folder of flag images, named in relations to the countries database ID. Current data grid code is...
1
1862
by: Dexter | last post by:
Hello all, I have a datagrid with "create columns automatically at run time" checked, and this datagrid show dynamic tables, then the column numbers is dynamic. I need to include a template column at end of datagrid. I have all code, but the template column is add always at column number 0.
1
1491
by: RN | last post by:
Hi. I used this article to add a template column to a datagrid that is entirely created with code: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskcreatingtemplatesprogrammaticallyindatagridcontrol.asp It works fine except for one thing. My template column needs a field in the recordset that binds to the datagrid. The template column is an HTML radio button where the value of the radio button needs...
2
1828
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?
1
1295
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
1875
by: Ken Varn | last post by:
I have a problem where my DataGrid would not maintain the ViewState of my databound rows. I finally narrowed down the problem. If my first column is a template column, the view state for the DataGrid items is not maintained on postback for some reason. I basically re-created my DataGrid again just to make sure this was indeed the problem. The ViewState was fine until I added the template column at the beginning of the Columns list. ...
1
1454
by: louise raisbeck | last post by:
This sounds complicated but bear with me. I have a datagrid. It is dynamic in that, i dont know how many columns i will have until the dataset is back so i have to build the datagrid dynamically. I know there will be at least one column required however, so I have put into my aspx a template column with a checkbox in it. Then for the number of columns in my dataset more than 1 I want to copy that templatecolumn and duplicate it for the...
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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
9426
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
9281
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...
0
9142
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...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4525
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
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.