feat: add SavingDataFromDatagridviewToXlsx SDK example#37
feat: add SavingDataFromDatagridviewToXlsx SDK example#37dessyordanova wants to merge 5 commits intomasterfrom
Conversation
Auto-generated from KB article: saving-data-from-datagridview-to-xlsx-file-in-csharp
There was a problem hiding this comment.
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
SavingDataFromDatagridviewToXlsxsample 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.
|
|
||
| if (header.Contains("price") || header.Contains("amount") || header.Contains("unit")) |
| 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}" |
|
@copilot resolve the merge conflicts in this pull request |
…eout Agent-Logs-Url: https://github.com/telerik/document-processing-sdk/sessions/fce03e6d-2a42-462a-8c91-ec51cc28b4e2 Co-authored-by: dessyordanova <3426684+dessyordanova@users.noreply.github.com>
Resolved in d3df6be. The |
Auto-generated from KB article: saving-data-from-datagridview-to-xlsx-file-in-csharp