image in template column in datagrid

Discussion in 'ASP .Net' started by =?Utf-8?B?TWljaGVsbGUgU3RvbmU=?=, Jan 21, 2004.

  1. 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
     
    =?Utf-8?B?TWljaGVsbGUgU3RvbmU=?=, Jan 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Hammond
    Replies:
    1
    Views:
    3,686
    bruce barker
    Nov 26, 2003
  2. Dexter
    Replies:
    1
    Views:
    440
    Eliyahu Goldin
    Jan 18, 2005
  3. Ken Varn
    Replies:
    1
    Views:
    993
    Ken Varn
    Aug 19, 2005
  4. Charleees
    Replies:
    2
    Views:
    8,279
    Eliyahu Goldin
    Jun 20, 2006
  5. Ravichandran Mahalingam

    Bound Column or Template Column (w dAdapater?) in DataGrid

    Ravichandran Mahalingam, Jan 9, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    251
    Ravichandran Mahalingam
    Jan 9, 2004
Loading...

Share This Page