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

hide image from exporting to pdf

1 Answer 10 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vasya Ivanov
Top achievements
Rank 1
Vasya Ivanov asked on 07 Dec 2010, 06:25 PM

Hi guys,
I have a following code in my aspx page:

 

<

 

telerik:GridTemplateColumn HeaderText ="Eis-Id" UniqueName ="PRICol" Groupable="true" DataField="FILENO" SortExpression="FILENO" ReadOnly="true" HeaderButtonType="TextButton">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="PRI" runat="server" ></asp:Label>

 

 

 

<asp:Image ID="Image1" runat="server" AlternateText="EIS CHARGES"/>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 


When I export grid to pdf I need to hide image label.I need just PRI label on the report.

I add some code but entire column disappeared from pdf:

DetailGrid.MasterTableView.GetColumn(

"PRICol").Visible = false;

 


Thanks so much for your help.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 07 Dec 2010, 10:52 PM
Hello Vasya,

You can hide the image in the ItemDataBound event:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem && isExport)
    {
        e.Item.FindControl("Image1").Visible = false;
    }
}

Regards,
Daniel
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
Vasya Ivanov
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or