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

pdfexport remove header

2 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phillip
Top achievements
Rank 1
Phillip asked on 16 Mar 2012, 05:35 PM
is it possible to remove the following code from the rawHTML used to generate pdf?

<thead>
        <tr>
            <th scope="col"> </th>
        </tr>
    </thead>

This is the header, but I have showheader at false and it is still rendering these items. 

2 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 17 Mar 2012, 06:20 AM
Hello Phillip,

protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
    {
        int startindex = e.RawHTML.IndexOf("<thead>");
        int endindex = e.RawHTML.IndexOf("</thead>");
 
        e.RawHTML = e.RawHTML.Substring(0, startindex) + e.RawHTML.Substring(endindex + 8);
    }


Thanks,
Jayesh Goyani
0
Phillip
Top achievements
Rank 1
answered on 23 Mar 2012, 05:03 PM
That is awesome and it works.  I will definitely be using this for other needs.  Thanks
Tags
Grid
Asked by
Phillip
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Phillip
Top achievements
Rank 1
Share this question
or