PDA

Click to See Complete Forum and Search --> : displaying image on datagrid


john83
May 25th, 2005, 10:09 AM
can't seem to display an image even after i made a template col for image.

Error:
System.ArgumentException: Image is neither a DataColumn nor a DataRelation for table Cart.

Codes:
<Columns>
<asp:TemplateColumn Visible="True">
<ItemTemplate><img src='<%# Container.DataItem("Image") %>'></ItemTemplate>
</asp:TemplateColumn>
......

I'm using a DataTable to bind to my datagrid.
Container.DataItem("Image") is actually a filename in string format
eg: mypicture.gif

What should i do?