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

Exporting - events

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Samantha
Top achievements
Rank 1
Samantha asked on 09 Oct 2008, 04:40 PM
I was looking at this link:

http://www.telerik.com/help/aspnet-ajax/grdexport.html

and I don't see the ExcelExportCellFormatting event.  I need to make sure a certain column gets exported as text rather than a number.

Also, can I exclude some columns from being exported?

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 13 Oct 2008, 03:21 PM
Hi Samantha,

You can find the OnExcelMLExportStylesCreated, OnExcelMLExportRowCreated and OnExcelExportCellFormatting events description and samples in this help topic, it is just after the Pdf exporting code samples.

You can hide particular columns before exporting. Note that you have to set the IgnorePaging property of the ExportSettings to true, or Rebind the grid before exporting to achieve your goal:

protected void btnExport_Click(object sender, System.EventArgs e)  
{  
    GridColumn col = RadGrid1.MasterTableView.GetColumnSafe("ColumnUniqueName");  
    col.Visible = false;  
    RadGrid1.Rebind();  
    RadGrid1.MasterTableView.ExportToExcel();  

Let me know if this helps.

Greetings,
Iana
the Telerik team

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