Completed
Last Updated: 26 Jun 2012 07:07 by ADMIN
ADMIN
Ivan Petrov
Created on: 26 Jun 2012 07:07
Category: GridView
Type: Feature Request
0
Add ability to enable AutoFilter functionality of Excel in the ExportToExcelML.
There should be a way to enable the auto filter functionality of Excel when exporting a grid through ExportToExcelML.
To enable the AutoFilter for cells C1 to C4 on row 2:
ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
exporter.ExcelTableCreated += new ExcelTableCreatedEventHandler(exporter_ExcelTableCreated);
exporter.RunExport(file.FullName);
private void exporter_ExcelTableCreated(object sender, ExcelTableCreatedEventArgs e)
{
AutoFilterElement el = new AutoFilterElement();
el.Attributes.Add("x:Range", "R2C1:R2C4");
el.Attributes.Add("xmlns", "urn:schemas-microsoft-com:office:excel");
e.ExcelTableElement.Workbook.Worksheets[0].InnerElements.Add(el);
}
private class AutoFilterElement : Telerik.WinControls.UI.Export.ExcelML.ElementBase
{
protected override string StartTag
{
get { return "<AutoFilter{0}>"; }
}
protected override string EndTag
{
get { return "</AutoFilter>"; }
}
}
0 comments