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

gridview export method

0 Answers 35 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
asked on 05 Mar 2017, 11:46 PM

In addition to the class provided by the class, I ask if there are any classes or methods that can be applied to a class that has style gridview

ex) no applied style gridview export option source, I want to applied style gridview export option

 public bool SaveDocument_GridViewUse(RadGridView gridViewList, ExcelExportTypeFDC selectedFormat)
        {
            try
            {
                string fileName;
                string appFileName = "";
                using (Stream stream = CreateFile(out fileName, selectedFormat))
                {
                        gridViewList.Export(stream, new GridViewExportOptions() {
                        Format = ExportFormat.Csv,
                        ShowColumnHeaders = true,
                    });
                }

                if (selectedFormat == ExcelExportTypeFDC.Xlsx) appFileName = "excel.exe";
                else if (selectedFormat == ExcelExportTypeFDC.Csv) appFileName = "excel.exe";
                else if (selectedFormat == ExcelExportTypeFDC.Txt) appFileName = "notepad.exe";

                ProcessStartInfo pInfo = new ProcessStartInfo(appFileName, fileName);
                pInfo.WindowStyle = ProcessWindowStyle.Maximized;
                Process.Start(pInfo);
            }

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Top achievements
Rank 1
Share this question
or