I need to add some table handling capability to a project that I’m working on.
The project is Windows C# XAML and the requirement is to have a RichTextBox on a form. In that RichTextBox there is a table that the user can edit. The result can be both serialized/deserialized with buttons AND can be added to a Word file using another button.
The conceptual visual is attached.
I only care about the RichTextBox for this project. The other fields in the attached image are there to show context.
Here are the requirements:
Format: C# XAML Application (I need the code of course – not just the exe) and it does not rely on third party libraries.
In a Window there is a RichTextBox. The user can add a table to that field with an Add Table button. The table would look like the one in the image above with four columns and two rows. It can be built in code.
The user can add a row to the table with an Add Row button. This would add a row underneath the current row (where the caret is positioned).
The user can delete a row from the table with a Delete Row button. This would delete the row where the caret is currently positioned.
The user can also Add Columns, Delete Columns in a similar manner to the Row events above.
The user can make a column wider with the Increase Width button. This would widen the column where the caret is currently positioned. Each click would increase the width by an amount set in a variable (say a default of 10pixels).
The user can make a column more narrow with the Decrease Width button. Each click would reduce the width by an amount set in a variable (say a default of 10pixels).
The user can Save/Serialize the FlowDocument belonging to the RichTextBox to a file (XMLSerialization) with a Save button.
The user can Open a serialized FlowDocument with an Open button. and the RichTextBox then displays the content from that file.
Now for the output to Word:
The user clicks a Insert into Word button and the content of the FlowDocument is appended to an existing word file that the user selects.
In the Word document, the table looks the same as in the RichTextBox.
I’d like you to use [login to view URL] for this. I’ve tried exporting to rich text but it just doesn’t give the result that I need. Also – we cannot use [login to view URL] to use the Word application to do the work. We have to build the table and inject it into the DOCX file without it.
That means we need a method to process the FlowDocument table and turn it into a DocumentFormat.OpenXml.Wordprocessing.Table.
15 freelancers are bidding on average $619 for this job
Hello Client! I have gone through your project description. You want to get work document as doing same as RichTextBox by using OpenXML. I can do it and can help you. Please contact me and discuss in detail. Thanks.