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

Displaying an image in RadGrid

3 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Niels
Top achievements
Rank 1
Niels asked on 18 Jul 2008, 02:41 PM

Hello,

I have a RadGrid with a ASP:Image in it, i would like to set the image url, i have it stored as a string in the Datasource of the Radgrid. But i can not seem to figure out how to get this value back. This is what i have so far : 

<telerik:GridTemplateColumn UniqueName="TemplateColumn">
    <ItemTemplate>
        <asp:Image ID="Image1" ImageUrl="<% = %>" runat="server" />
    </ItemTemplate>
</telerik:GridTemplateColumn>

All i need is the javascript code that goes in the <%= %> that returns the value of the Datasource field "pad".

Thanks in advance,

Niels ter Horst

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 21 Jul 2008, 05:44 AM
Hi Niels,

You can use binding expression syntax to achieve this:

<%# Eval("YourFieldName") %>

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shinu
Top achievements
Rank 2
answered on 21 Jul 2008, 06:09 AM
Hi Niels,

You can also go through the following online demo and see how the Image is bound.
Filtering template columns

Thanks
Shinu.
0
Niels
Top achievements
Rank 1
answered on 21 Jul 2008, 07:39 AM
Thanks Vlad your suggestion worked great.

Sincerly

Niels ter Horst
Tags
Grid
Asked by
Niels
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Shinu
Top achievements
Rank 2
Niels
Top achievements
Rank 1
Share this question
or