void btnExport_Click(object sender, RoutedEventArgs e){
string extension = "xls";
SaveFileDialog dialog = new SaveFileDialog()
{
DefaultExt = extension,
Filter = String.Format("{1} files (.{0})|.{0}|All files (.)|.", extension, "Excel"),
FilterIndex = 1
};
if (dialog.ShowDialog() == true)
{
using (Stream stream = dialog.OpenFile())
{
gridViewExport.Export(stream,
new GridViewExportOptions()
{
Format = ExportFormat.Html,
ShowColumnHeaders = true,
ShowColumnFooters = true,
ShowGroupFooters = false,
});
}
}
}
برچسب:
نویسنده: خنج