-
Notifications
You must be signed in to change notification settings - Fork 56
965408 - Add sample for cloned table row with restart list numbering #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MathanKumarVaradhaRajaPerumal
merged 2 commits into
main
from
965408-Add-Sample-for-Cloned-and-add-table-row-with-restart-numbered-list
Jan 28, 2026
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...w-with-restart-numbered-list/.NET/Cloned-and-add-table-row-with-restart-numbered-list.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.14.36518.9 d17.14 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cloned-and-add-table-row-with-restart-numbered-list", "Cloned-and-add-table-row-with-restart-numbered-list\Cloned-and-add-table-row-with-restart-numbered-list.csproj", "{78E727C6-B0F8-43EF-91CA-FCBD28CE9A70}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {78E727C6-B0F8-43EF-91CA-FCBD28CE9A70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {78E727C6-B0F8-43EF-91CA-FCBD28CE9A70}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {78E727C6-B0F8-43EF-91CA-FCBD28CE9A70}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {78E727C6-B0F8-43EF-91CA-FCBD28CE9A70}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {1444F73B-CB15-4B82-A264-556FD70226DE} | ||
| EndGlobalSection | ||
| EndGlobal |
24 changes: 24 additions & 0 deletions
24
...row-with-restart-numbered-list/Cloned-and-add-table-row-with-restart-numbered-list.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <RootNamespace>Cloned_and_add_table_row_with_restart_numbered_list</RootNamespace> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Update="Data\Input.docx"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="Output\.gitkeep"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Binary file added
BIN
+23 KB
...rt-numbered-list/.NET/Cloned-and-add-table-row-with-restart-numbered-list/Data/Input.docx
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...rt-numbered-list/.NET/Cloned-and-add-table-row-with-restart-numbered-list/Output/.gitkeep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| |
47 changes: 47 additions & 0 deletions
47
...restart-numbered-list/.NET/Cloned-and-add-table-row-with-restart-numbered-list/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using Syncfusion.DocIO.DLS; | ||
|
|
||
| namespace Cloned_and_add_table_row_with_restart_numbered_list | ||
| { | ||
| class Program | ||
| { | ||
| public static void Main(string[] args) | ||
| { | ||
| // Load the existing Word document | ||
| WordDocument document = new WordDocument(Path.GetFullPath(@"Data\Input.docx")); | ||
| // Retrieve the first table from the last section of the document | ||
| WTable table = (WTable)document.LastSection.Tables[0]; | ||
| // Clone the third row (index 2) of the table | ||
| WTableRow clonedRow = table.Rows[2].Clone(); | ||
| // Insert the cloned row back into the table at position 3 (after the original row) | ||
| table.Rows.Insert(3, clonedRow); | ||
| // Iterate through all cells in the newly inserted row (row index 3) | ||
| foreach (WTableCell cell in table.Rows[3].Cells) | ||
| { | ||
| // Flag to track whether the first list paragraph has been encountered | ||
| bool isListStart = false; | ||
| // Iterate through all paragraphs inside the current cell | ||
| foreach (WParagraph paragraph in cell.Paragraphs) | ||
| { | ||
| // Check if paragraph is a list | ||
| if (paragraph.ListFormat.ListType != ListType.NoList) | ||
| { | ||
| // If a list has already started, continue numbering to align with the existing list | ||
| if (isListStart) | ||
| paragraph.ListFormat.ContinueListNumbering(); | ||
| else | ||
| { | ||
| // Mark that the first list paragraph has been found | ||
| isListStart = true; | ||
| // Restart numbering for the first list paragraph in the cloned ro | ||
| paragraph.ListFormat.RestartNumbering = true; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| // Save the Word document | ||
| document.Save(Path.GetFullPath("../../../Output/Output.docx")); | ||
| // Close the Word document | ||
| document.Close(); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check row spelling