2012-08-13 67 views

回答

5
void Button1_Click(object sender, EventArgs e) 
{ 
    exporting = true; 
    RadGrid1.Rebind(); 
    RadGrid1.MasterTableView.ExportToExcel(); 
} 

void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
{ 
    if (exporting && e.Item.ItemType == Telerik.Web.UI.GridItemType.FilteringItem) 
    { 
     e.Item.Visible = false; 
    } 
} 
+0

在我的情況和這個答案中不需要重新綁定:http://www.telerik.com/forums/excel-export-how-to-remove-filter-buttons-etc – yezior 2015-03-31 12:35:47