private void bbExportHistory_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { XtraFolderBrowserDialog dialog = new XtraFolderBrowserDialog(); if (dialog.ShowDialog() != DialogResult.OK) { return; } GridControl gc = new GridControl(); GridView view = new GridView(); gc.ViewCollection.Add(view); gc.MainView = view; gc.DataSource = new BindingSource() { DataSource = typeof(DependencyArbitrageHistoryItem) }; gc.BindingContext = new BindingContext(); gc.ForceInitialize(); view.PopulateColumns(); ArbitrageHelper.Items.ForEach(i => i.SaveHistory()); ArbitrageHelper.Items.ForEach(i => { StatisticalArbitrageStrategy info = new StatisticalArbitrageStrategy(); info.Assign(i); info.LoadHistory(); gc.DataSource = info.History; gc.ExportToXlsx(dialog.SelectedPath + "\\" + info.GetExportFileName() + ".xlsx"); }); System.Diagnostics.Process.Start(dialog.SelectedPath); }