This is a migrated thread and some comments may be shown as answers.

Display Image in RadGrid

1 Answer 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 15 Aug 2012, 07:20 PM
Can anyone tell me how to get the following to work?  Its not showing my image...  If you supply code please use VB.. sorry C# isn't my strong point.

Thanks!

<telerik:GridTemplateColumn DataField="CountryName"
                            FilterControlAltText="Filter CountryName column" HeaderText="CountryName"
                            SortExpression="CountryName" UniqueName="CountryName" >
    <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("CountryAbbreviation") %>'></asp:Label>
        <asp:Image ID="Image1" runat="server" ImageUrl='images/<%# Eval("CountryAbbreviation") %>.png' />
    </ItemTemplate>
</telerik:GridTemplateColumn>

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Aug 2012, 07:43 AM
Hi Aaron,

Please try the following code snippet to show the image.

ASPX:
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "images/" + Eval("CountryAbbreviation") +".png"%>'  />

Thanks,
Princy.
Tags
Grid
Asked by
Aaron
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or