Export to... error

Jun 29, 2015 at 2:01 PM
How to solve the export?

So I tried:
protected void Export(object parameter)
        {
            if (parameter is ExtendedDataGrid)
            {
                SaveFileDialog save = new SaveFileDialog();
                save.Filter = "Excel(*.xls)|*.xls|Adobe PDF file (*.pdf)|*.pdf|CSV (MS-DOS) (*.csv)|*.csv";
                if (save.ShowDialog() == DialogResult.OK)
                {
                    ExtendedDataGrid dataGrid = (ExtendedDataGrid)parameter;

                    switch (save.FilterIndex)
                    {
                        case 1:
                            dataGrid.ExportToExcel("Work", save.FileName, ExcelTableStyle.Light1, true);
                            break;

                        case 2:
                            dataGrid.ExportToPdf("Work", save.FileName, ExcelTableStyle.Light1, true);
                            break;

                        case 3:
                            dataGrid.ExportToCsv("Work", save.FileName, true);
                            break;

                        default:
                            Messages.ErrorMessage("Unauthorized file format.", "Save failed");
                            break;
                    }
                }
            }
            else
                Messages.ErrorMessage("", "Save failed");
        }
ExportTo... return the error: "In case CanSelectMultipleItems true value can only be called the SelectAll method."

I try call dataGrid.SelectAll(), but as I get this error.
Jun 30, 2015 at 7:40 AM
Solved the problem.

SelectionMode="Single" and ExportTo it does not cooperate.
Marked as answer by Destroy666 on 6/30/2015 at 12:40 AM