private void ExportToExcel()
        {
            //if (System.Windows.Interop.BrowserInteropHelper.IsBrowserHosted)
            //{
            //MessageBox.Show("Due to restricted user-access permissions, this feature cannot be demonstrated when the Live Explorer is running as an XBAP browser application. Please download the full Xceed DataGrid for WPF package and run the Live Explorer as a desktop application to try out this feature.", "Feature unavailable");
            //return;
            //}

            // The simplest way to export in Excel format is to call the
            // DataGridControl.ExportToExcel() method. However, if you want to specify export
            // settings, you have to take the longer, more descriptive and flexible route:
            // the ExcelExporter class.

            // excelExporter.FixedColumnCount will automatically be set to the specified
            // grid's FixedColumnCount value.
            //ExcelExporter excelExporter = new ExcelExporter(this.GridDetails);
            //excelExporter.ExportStatFunctionsAsFormulas = this.exportStatFunctionsAsFormulasCheckBox.IsChecked.GetValueOrDefault();
            //excelExporter.IncludeColumnHeaders = this.includeColumnHeadersCheckBox.IsChecked.GetValueOrDefault();
            //excelExporter.IsHeaderFixed = this.isHeaderFixedCheckBox.IsChecked.GetValueOrDefault();
            //excelExporter.RepeatParentData = this.repeatParentDataCheckBox.IsChecked.GetValueOrDefault();
            //excelExporter.DetailDepth = Convert.ToInt32(this.detailDepthTextBox.Value);
            //excelExporter.StatFunctionDepth = Convert.ToInt32(this.statFunctionDepthTextBox.Value);
            //excelExporter.UseFieldNamesInHeader = this.UseFieldNamesInHeaderCheckBox.IsChecked.GetValueOrDefault();

            Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog();

            saveFileDialog.Filter = "XML Spreadsheet (*.xml)|*.xml|All files (*.*)|*.*";

            try
            {
                if (saveFileDialog.ShowDialog().GetValueOrDefault())
                {
                    using (Stream stream = saveFileDialog.OpenFile())
                    {
                        //excelExporter.Export(stream);
                        GridDetails.ExportToExcel(stream);
                    }
                }
            }
            catch { }
        }