hi,
when i convert a radgrid into pdf the image button disappear in the pdf file,
help me
here my code
<ExportSettings IgnorePaging="false" OpenInNewWindow="true">
<Pdf PageHeight="270mm" PageWidth="297mm" PageTitle="Master Billing Report" PageBottomMargin="20mm"
PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" />
</ExportSettings>
<telerik:GridTemplateColumn HeaderText="Image" UniqueName="imgbyte">
<ItemTemplate>
<asp:ImageButton ID="asdf" Width="90px" Height="68px" Style="border: 1px solid #000000;"
runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
cs code
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.ExportToPdfCommandName)
isPdfExport = true;
}
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (isPdfExport)
FormatGridItem(e.Item);
}
protected void FormatGridItem(GridItem item)
{
item.Style["color"] = "#eeeeee";
if (item is GridDataItem)
{
item.Style["vertical-align"] = "middle";
item.Style["text-align"] = "center";
}
switch (item.ItemType) //Mimic RadGrid appearance for the exported PDF file
{
case GridItemType.Item: item.Style["background-color"] = "#4F4F4F"; break;
case GridItemType.AlternatingItem: item.Style["background-color"] = "#494949"; break;
case GridItemType.Header: item.Style["background-color"] = "#2B2B2B"; break;
case GridItemType.CommandItem: item.Style["background-color"] = "#000000"; break;
}
if (item is GridCommandItem)
{
item.PrepareItemStyle(); //needed to span the image over the CommandItem cells
}
}
when i convert a radgrid into pdf the image button disappear in the pdf file,
help me
here my code
<ExportSettings IgnorePaging="false" OpenInNewWindow="true">
<Pdf PageHeight="270mm" PageWidth="297mm" PageTitle="Master Billing Report" PageBottomMargin="20mm"
PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" />
</ExportSettings>
<telerik:GridTemplateColumn HeaderText="Image" UniqueName="imgbyte">
<ItemTemplate>
<asp:ImageButton ID="asdf" Width="90px" Height="68px" Style="border: 1px solid #000000;"
runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
cs code
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.ExportToPdfCommandName)
isPdfExport = true;
}
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (isPdfExport)
FormatGridItem(e.Item);
}
protected void FormatGridItem(GridItem item)
{
item.Style["color"] = "#eeeeee";
if (item is GridDataItem)
{
item.Style["vertical-align"] = "middle";
item.Style["text-align"] = "center";
}
switch (item.ItemType) //Mimic RadGrid appearance for the exported PDF file
{
case GridItemType.Item: item.Style["background-color"] = "#4F4F4F"; break;
case GridItemType.AlternatingItem: item.Style["background-color"] = "#494949"; break;
case GridItemType.Header: item.Style["background-color"] = "#2B2B2B"; break;
case GridItemType.CommandItem: item.Style["background-color"] = "#000000"; break;
}
if (item is GridCommandItem)
{
item.PrepareItemStyle(); //needed to span the image over the CommandItem cells
}
}