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

RadGrid Export to Excel problem with StaticHeaders

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bhavani Arunachalam
Top achievements
Rank 1
Bhavani Arunachalam asked on 21 Nov 2008, 09:21 AM
Hi
I have an issue with the Radgrid with the StaticHeader and exporttoexcel. The grid is bound to a generic list on a button click event and then code Export to Excel is written. Grid has the UseStaticHeaders as true. But in the output the headers are not static instead scrolls upward.
Sample code :

protected

void Button3_Click(object sender, EventArgs e)

 

{

load();// loads the plist that is generic List

RadGrid1.DataSource = plist;

BuildgridColumnsForAnalysisReport();

RadGrid1.DataBind();

RadGrid1.AutoGenerateColumns =

false;

 

 

RadGrid1.ExportSettings.FileName =

"_Report";

 

RadGrid1.ExportSettings.IgnorePaging =

true;

 

RadGrid1.ExportSettings.OpenInNewWindow =

true;

 

RadGrid1.ExportSettings.ExportOnlyData =

true;

 

RadGrid1.MasterTableView.ExportToExcel();

 

}
In the output , the header of the columns in the Grid are not static instead scroll as we move the verticle scroll bar.
Your help is appreciated.
Regards
Bhavani.A

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 24 Nov 2008, 02:52 PM
Hi Bhavani,

The grid headers will remain static only when part of the html table thead of the control rendered in the browser (as demonstrated in this demo). When you export the grid content to Excel, the headers will become part of the actual Excel file content and will not be static when you scroll the data in the document.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Bhavani Arunachalam
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or