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

Export to PDF

3 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jayanthi
Top achievements
Rank 1
jayanthi asked on 21 Dec 2012, 05:30 AM
While export to PDF from radgrid, it displays FALSE below header, its is due to Allow Filtering Check box column value. If i set AllowFiltering=False; then it doesn't display FALSE. But i need Allow filtering as True.
I have attached an image. How to remove False below header?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 21 Dec 2012, 06:15 AM
Hi,

One suggestion is that you can hide the column before exporting.
C#:
protected void Button1_Click(object sender, EventArgs e)
   {
       RadGrid1.MasterTableView.GetColumn("Uniquename").Display = false;
       RadGrid1.MasterTableView.ExportToPdf();
   }

Thanks,
Princy.
0
jayanthi
Top achievements
Rank 1
answered on 21 Dec 2012, 08:25 AM
It hides the entire column. But I need to export the value.
0
Princy
Top achievements
Rank 1
answered on 24 Dec 2012, 05:53 AM
Hi,

One suggestion is to first set the property ExportOnlyData to 'false'  and then  set it to 'True' while exporting after Filtering.

C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {  
        filter = true;        
    }
    if (e.CommandName == RadGrid.ExportToPdfCommandName)
    {
        if (filter == true)
        {
            RadGrid1.ExportSettings.ExportOnlyData = true;
        }
        else
        {
            RadGrid1.ExportSettings.ExportOnlyData = false;
        }         
    }
}

Thanks,
Princy.
Tags
Grid
Asked by
jayanthi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
jayanthi
Top achievements
Rank 1
Share this question
or