MergeCellsInColumn not actually merging cells?

May 16, 2014 at 4:23 AM
Edited May 16, 2014 at 4:53 AM
I'm having an issue where I'm trying to merge some cells in a column. When I do this everything looks fine in Word, but if I try to resize the column the merged cells are in, the hidden rows all appear again. Right clicking in word allows me to merge the cells and get the expected behavior. Additionally, when I try to iterate through each row and column and add a value to the table cells, I can still access the hidden rows. That is, merging them does not add their data to the new cell, and when they are unhidden through resizing in word, the values are then visible. Manually merging through word merges the values as expected.

Is this a bug or am I doing something wrong?

Just for the record here's the code that produces this situation:
                Table t = document.InsertTable(5, 2);
                t.Design = TableDesign.TableGrid;
                t.Rows[0].MergeCells(0, 1);
                // t.AutoFit = AutoFit.Window;
                t.Rows[1].Cells[1].Width = 400;

                for (int i = 0; i < t.RowCount; ++i)
                    for (int j = 0; j < t.Rows[i].ColumnCount; ++j)
                        if (j < t.Rows[i].Cells.Count)
                            t.Rows[i].Cells[j].Paragraphs[0].Append(i.ToString() + " " + j.ToString());

                t.MergeCellsInColumn(0, 1, 3);