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

export to PDF , images not showing, Ajaxified Grid, images set in Grid.ItemDatabound

4 Answers 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neal
Top achievements
Rank 1
Neal asked on 14 Oct 2015, 10:33 AM

Hi

 

My item images don't show in this scenario.

i.e. Images are set within the Grids ItemDataBound event.

I did this because the grid is ajaxified and the RadCodeBlock issue raises it's requirement.

<Telerik:GridTemplateColumn      HeaderText="Image" UniqueName="ViewImage">
     <ItemTemplate>
          <asp:Image ID="PartImage" runat="server" Width="35px" Height="35px" />
     </ItemTemplate>
     <ItemStyle Width ="6%" HorizontalAlign="Center" />
     <HeaderStyle CssClass="GridColHeader" Width="6%" HorizontalAlign="Center" wrap="True"/>
</Telerik:GridTemplateColumn>

 Code:

if (e.Item is GridDataItem)
{

    string Imgurl = Parts.GetMaxImageUrl(dataSourceRow.Image_Id);//Image_Id
GridDataItem item = (GridDataItem)e.Item;
Image img = (Image)item.FindControl("PartImage");
if (Imgurl != "")
{
string appPath = HttpContext.Current.Request.ApplicationPath;
string physicalPath = HttpContext.Current.Request.MapPath(appPath);
string ImageUrl = appPath + "/PartImages/" + Imgurl;
img.ImageUrl = "~/PartImages/" + Imgurl;
}
else
{
img.ImageUrl = "~/Images/placeholder-200.jpg";
}

 

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 16 Oct 2015, 03:15 PM
Hi,

As you have another ticket opened on the matter I will ask continue our communication there in order to prevent duplicate posts.

Regards,
Pavlina
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Neal
Top achievements
Rank 1
answered on 19 Oct 2015, 12:50 PM

Hi Pavllina

Nope. That ticket was about server code blocks and AjaxManager. that was corrected.

This about getting images in my grid to display in the PDF.

thx Neal

0
Accepted
Pavlina
Telerik team
answered on 22 Oct 2015, 12:29 PM
Hi,

Did you try setting ExportOnlyData property to false? If this property is disabled the images should be displayed in the PDF file.

Regards,
Pavlina
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Neal
Top achievements
Rank 1
answered on 22 Oct 2015, 12:56 PM

Hi Pavlina,

thx, Yes I did and all is good.

Rgds

Neal

Tags
Grid
Asked by
Neal
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Neal
Top achievements
Rank 1
Share this question
or