protected override void CustomExport(object sender, DevExpress.ExpressApp.SystemModule.CustomExportEventArgs e) { base.CustomExport(sender, e); //Export only selected rows ASPxGridViewExporter exporter = e.Printable as ASPxGridViewExporter; if (exporter != null) { exporter.ExportSelectedRowsOnly = true; } }
void winExportController_Exported(object sender, DevExpress.ExpressApp.SystemModule.CustomExportEventArgs e) { if (e.Stream is FileStream) { string fileName = ((FileStream)e.Stream).Name; if (File.Exists(fileName)) { e.Stream.Close(); if (WinApplication.Messaging.GetUserChoice("Open the exported file?", GetMessageBoxCaption(), MessageBoxButtons.YesNo) == DialogResult.Yes) { Process.Start(fileName); } } } }
protected override void CustomExport(object sender, DevExpress.ExpressApp.SystemModule.CustomExportEventArgs e) { base.CustomExport(sender, e); //Show a message before exporting a Grid List Editor GridListEditor gridListEditor = ((DevExpress.ExpressApp.ListView)View).Editor as GridListEditor; if (gridListEditor != null) { GridView gridView = gridListEditor.GridView; if (HasCollapsedGroups(gridView)) { string message = "There are collapsed groups in the grid. Expand all groups in the exported file?"; gridView.OptionsPrint.ExpandAllGroups = WinApplication.Messaging.GetUserChoice(message, GetMessageBoxCaption(), MessageBoxButtons.YesNo) == DialogResult.Yes; } } }