This project has moved and is read-only. For the latest updates, please go here.

Sequence contains no elements exception when setting Table.Design

Jan 25, 2016 at 8:04 PM
When setting TableDesign.None to table without design setter raises InvalidOperationException

Simplest way to reproduce:
DocX templateDocument = DocX.Create(resultFileName);
Table table = templateDocument.AddTable(1, 1);
Table insertedTable = templateDocument.InsertTable(table);
insertedTable.Design = TableDesign.None;
insertedTable.Design = TableDesign.None;
Add return in Table.cs at line 754
like this
if (design == TableDesign.None)
                    if (style != null)
Jan 25, 2016 at 8:23 PM
Thanks. Does it have any drawbacks?
Jan 30, 2016 at 10:10 AM
Excuse me, my english is not good, so I' ve not understood the question. Do you mean "does fix has any side effects" or "how big is chance to catch this bug in "real word""?
Feb 4, 2016 at 8:11 AM
WIll it break things for people who are already using DocX, will it have any impact on any other codes... or is it safe bug fix.
Sep 7, 2016 at 3:36 PM
Hello there,
I want to ask you if you are going to apply this fix above into DLL to download?
I'm asking since i'm beginner with C# and i'm unable to rebuild your project under my environment and after hours of fighting i gave up.
So i have DLL file in version which contains theme bug which stops me from proceeding with my project based on your moreover useful library.
Sep 7, 2016 at 3:40 PM
Have you checked Github? In the sources there are binaries included. I'm not sure if it's there... but it may be... if not it's not hard to add I guess. Just need to know the drawbacks of that..
Sep 7, 2016 at 4:06 PM
Thanks for your quick reply.
Neither sources at GitHub, nor DLL file contain the fix, so it won't help.
I don't know if there are any drawbacks caused by this fix, i can't tell because i'm unable to build fixed version for myself.

Anyway, thank you for your consideration.
Sep 16, 2016 at 8:27 AM
Fix doesn't work. I've added unit test to code but return doesn't solve this issue. Feel free to add fix in github thou for this.