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

Image Not Displaying in Nested Template View

4 Answers 92 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Kevin Mauriello
Top achievements
Rank 1
Kevin Mauriello asked on 05 May 2010, 03:50 AM
I took your example from Grid/Herarchy With Templates, other than the database fields being different the only change I made was to replace:

this
<img  src='<%#  Page.ResolveUrl("~/Grid/Examples/Hierarchy/NestedViewTemplate/Img/") + (Container.FindControl("Label1") as Label).Text %>.jpg' alt="Customer Image" />

with this:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource4"
    <ItemTemplate> 
        <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" 
            DataValue='<%#Eval("Avatar") %>' Width="90px" Height="110px" ResizeMode="Fit"/> 
    </ItemTemplate> 
</asp:DataList> 
 

I need to retrieve the image from the database.
The first image is correct, but all images after that fail.  When I modify the PreRender to loop through each item and expand each item it works fine, for the first page (the second page is all empty images).

I have a feeling this is going to be a dumb mistake by me, please help.

Here is what it looks like:

4 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 05 May 2010, 02:42 PM
Hello Kevin,

Can you please verify that the RadBinaryImage/its binding container is databound when the NestedViewTemplate is expanded. Also can you please provide a bit more information about the grid's declaration, some code snippets etc.

Kind regards,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kevin Mauriello
Top achievements
Rank 1
answered on 06 May 2010, 02:16 AM
That did it, I put the datalist.databind in the itemcommand event.

Thanks
0
Miguel
Top achievements
Rank 1
answered on 29 Jan 2011, 01:55 AM
Hello everyone,

Regarding this issue, how can I reference the Datalist control if it is nested in the the grid. I try to reference it within the code behind and can't get it done. I use advance databind for the Grid and also have to use it for the datalist. In which event should I put my code?

Thanks!
Miguel
0
Kiara
Top achievements
Rank 1
answered on 01 Feb 2011, 12:05 PM
As with other regular web grid, you should be able to listen for the ItemCreated or ItemDataBound server event and locate your nested datalist using e.Item.FindControl(datalistId) method. Inspect this doc for details about these two telerik grid events.

Kiara
Tags
BinaryImage
Asked by
Kevin Mauriello
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Kevin Mauriello
Top achievements
Rank 1
Miguel
Top achievements
Rank 1
Kiara
Top achievements
Rank 1
Share this question
or