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

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:TemplateColumn HeaderText="Status"><ItemTemplate><asp:Image id=Image4 runat="server" ImageUrl='<%# gridGetImagePath (DataBinder.Eval(Container, "DataItem.nStatus").ToString ()) %>'></asp:Image></ItemTemplate></asp:TemplateColumn

the gridGetImagePath 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

approvalPendingPoliciesSet.Clear ()
sqlApprovalPendingPoliciesDataAdapter.Fill (approvalPendingPoliciesSet)

approvalGrid.DataSource = approvalPendingPoliciesSet
approvalGrid.DataMember = "TPolicy"
approvalGrid.DataKeyField = "IDPolicy"

// Set up column
approvalGrid.DataBind ()

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 1104

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

Similar topics

2
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...
1
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...
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: 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...
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: ...
2
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...
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: 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...
1
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.