Can someone provide an example of how to display an Image field in a WebDataGrid from a SQL Server table?
We don't have sample demonstrating this exact scenario but I think the following resources will help you accomplish what you need:
How to create a custom templated column:
How to create a column with a checkbox. This is similar to your case but instead of checkbox you'll have to add an image:
How to bind WebDataGrid to SqlDataSource:
All samples we have for WebDataGrid:
Thank you for the links. I am able to get this far, but what is displayed is a box with an "X". The datatype of the field in SQL Server is "Image".
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" AutoGenerateColumns="False" DataSourceID="ds_Current_User">
<asp:Image ID="Image1" runat="server" ImageUrl='<%# DataBinder.Eval(CType(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "Employee_Photo")%>' />
this is what is returned if I make the field a TemplateDataField:
this is what is returned if I leave the field as a BoundDataField:
The images stored into the database are encoded. In order to display them in an html img element you have to decode them. There is a lot of information on the internet how to do it. For example:
You could also check the following threads in our forum:
Hope this helps.