using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class Default6 : System.Web.UI.Page
{
    bool isExport = false;

    protected void Page_Init(object sender, EventArgs e)
    {
        RadGrid1.ItemCreated += new GridItemEventHandler(RadGrid1_ItemCreated);
    }

    void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridCommandItem && isExport)
        {
            TableCell commandCell = (e.Item as GridCommandItem).Cells[0];//...
            //TableCell headerCell = (e.Item as GridHeaderItem)["CustomerID"];
            Image img = new Image();
            img.ID = "Image1";
            img.ImageUrl = "Backgr.jpg";
            img.Width = Unit.Percentage(100);
            commandCell.Controls.Add(img);
            e.Item.PrepareItemStyle();
            //TableCell cell = new TableCell();
            //cell.ColumnSpan = RadGrid1.Columns.Count;
            //cell.Controls.Add(img);
            //TableRow row = new TableRow();
            //row.Cells.Add(cell);
            //e.Item.Controls.Add(row);        
        }
    }

    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
       
    }
    
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.ExportToPdfCommandName)
        {
            isExport = true;
            RadGrid1.Rebind();
        }
    }
    protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
    {

    }
    protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
    {

    }
}