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

Image not displayed in template column after making an Ajax call

3 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sanjay
Top achievements
Rank 1
Sanjay asked on 13 Jul 2011, 07:20 AM
Hi,
I am using the Telerik grid to display an image column alongwith other data columns. I am also making an Ajax call for data binding to allow for a searching records.The problem is that after that Ajax call the image column doesnt display anything.
I am using the template column for displaying the image as shown below:-

columns.Template(

@<text>

<img alt="@item.CountryIcon" style='width:30px;height:auto' src="@Url.Content("http://url.com/" + item.CountryIcon) "/>

</text>).Title(

"Icon_2").Width(30);


But the image is shown after an Ajax call when I use the client template code as shown below:-

columns.Bound(b => b.CountryIcon)

.ClientTemplate(

" <img alt='<#= CountryIcon #>' style='width:30px;height:auto' src=" + Url.Content("http://url.com/") + "<#= CountryIcon #> />")

.Title(

"Icon").Width(30);

The problem with the client template code is that the image is not shown on page load and only after the Ajax call is made.



I would like someone to suggest a solution for this problem.

3 Answers, 1 is accepted

Sort by
0
Sanjay
Top achievements
Rank 1
answered on 18 Jul 2011, 11:39 AM
Can somebody please post a reply to this issue?
0
Tsvetoslav
Telerik team
answered on 18 Jul 2011, 03:22 PM
Hi Sanjay,

Are you sure you are posting in the right forum as RadGrid for ASP.NET AJAX does not have a ClientTemplate property for it columns? 

Regards,
Tsvetoslav
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Sanjay
Top achievements
Rank 1
answered on 26 Jul 2011, 07:18 PM
Hi Tsvetoslav,

Sorry for posting in an inappropriate forum. I had posted here since even after days of posting in the ASP.net MVC forum there wasnt  a reply. Anyways I got a solution to the issue and it is at that post.
Link - http://www.telerik.com/community/forums/aspnet-mvc/general/image-not-displayed-in-template-column-after-making-an-ajax-call.aspx
Tags
Grid
Asked by
Sanjay
Top achievements
Rank 1
Answers by
Sanjay
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or