Subject: Displaying Images in a DataGrid
Posted By: RichardOrmiston Post Date: 12/13/2005 7:06:44 AM
How do you get html <img src=""> into a datagrid? I store the image path in a database, e.g butteredpopcorn.jpg

Here is what I have so far

<asp:DataGrid id="dgOutPut" runat="server" autogeneratecolumns="false">
<columns>
<asp:BoundColumn  datafield="Prod_Image"/>
</columns>
</asp:datagrid>

Reply By: RichardOrmiston Reply Date: 12/13/2005 12:13:33 PM
Sorted it myself, here is how

<asp:TemplateColumn>
<ItemTemplate>
<img src='assets/products/<%# Container.DataItem ("Prod_Image") %>' width='100' height='100'>
</ItemTemplate>
</asp:TemplateColumn>


Go to topic 37578

Return to index page 417
Return to index page 416
Return to index page 415
Return to index page 414
Return to index page 413
Return to index page 412
Return to index page 411
Return to index page 410
Return to index page 409
Return to index page 408