Skip to content

feat: add SavingDataFromDatagridviewToXlsx SDK example#37

Open
dessyordanova wants to merge 5 commits intomasterfrom
dess-saving-data-datagridview-xlsx-sdk
Open

feat: add SavingDataFromDatagridviewToXlsx SDK example#37
dessyordanova wants to merge 5 commits intomasterfrom
dess-saving-data-datagridview-xlsx-sdk

Conversation

@dessyordanova
Copy link
Copy Markdown
Contributor

Auto-generated from KB article: saving-data-from-datagridview-to-xlsx-file-in-csharp

Auto-generated from KB article: saving-data-from-datagridview-to-xlsx-file-in-csharp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new SpreadProcessing sample that demonstrates exporting WinForms DataGridView data to an XLSX workbook via Telerik RadSpreadProcessing. It fits the repo’s sample-library structure by introducing a new standalone example project and wiring it into the existing solution.

Changes:

  • Adds a new SavingDataFromDatagridviewToXlsx sample project and solution entry.
  • Implements a WinForms UI with sample tabular data and an XLSX export flow.
  • Documents the sample with a README linking back to the originating KB article.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
SpreadProcessing/SpreadProcessing_NetStandard.sln Registers the new sample project and solution folder/configurations.
SpreadProcessing/SavingDataFromDatagridviewToXlsx/SavingDataFromDatagridviewToXlsx_NetStandard.csproj Defines the WinForms SDK-style project and Telerik package references.
SpreadProcessing/SavingDataFromDatagridviewToXlsx/ReadMe.md Describes the sample and links to the KB article.
SpreadProcessing/SavingDataFromDatagridviewToXlsx/Program.cs Adds the WinForms application entry point.
SpreadProcessing/SavingDataFromDatagridviewToXlsx/Form1.Designer.cs Provides the base form designer partial class.
SpreadProcessing/SavingDataFromDatagridviewToXlsx/Form1.cs Implements sample data loading, export UI flow, and workbook generation logic.
Files not reviewed (1)
  • SpreadProcessing/SavingDataFromDatagridviewToXlsx/Form1.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +166 to +167

if (header.Contains("price") || header.Contains("amount") || header.Contains("unit"))
Comment on lines +89 to +103
try
{
ExportGridToXlsx(sfd.FileName);
if (MessageBox.Show("Export complete. Open file?", "Export", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
{
FileName = sfd.FileName,
UseShellExecute = true
});
}
}
catch (Exception ex)
{
MessageBox.Show($"Export failed:\n{ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
var xlsx = new XlsxFormatProvider();
using (var fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
{
xlsx.Export(workbook, fs, TimeSpan.FromSeconds(10));
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SavingDataFromDatagridviewToXlsx", "SavingDataFromDatagridviewToXlsx", "{EA8F6DCD-EC6F-F9BA-79A0-9C66C14FC371}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SavingDataFromDatagridviewToXlsx_NetStandard", "SavingDataFromDatagridviewToXlsx\SavingDataFromDatagridviewToXlsx_NetStandard.csproj", "{D10A71E6-7D4F-4184-B730-61F47A60B1EE}"
@dessyordanova
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown

Copilot AI commented May 7, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in d3df6be. The SpreadProcessing_NetStandard.sln was restored to match master (re-adding the SpreadprocessingInsertImageCellRangeAspectRatio project entries that were accidentally removed during the earlier merge). Also addressed the three code review issues: removed unit from currency detection, separated try/catch for export vs file-open errors, and updated the export timeout from 10 to 15 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants