DocX
DocX copied to clipboard
Row.ReplaceText not working in Header Tables
Row.ReplaceText behaves differently for tables in the Header than to tables in the body.
Example: A table with a single row containing the text "foo" is in the header. An exact copy of this table is in the body.
For the body table, we select the first row and insert it into the table as a new row (table.InsertRow). Then we use the row.ReplaceText method to change the text on the new row from "foo" to "bar". This results in a table with one row of "foo" and one row of "bar".
For the header table, we again select the first row and insert it into the table as a new row. However this time when we try to use the row.ReplaceText method to change the text on the new row from "foo" to "bar", it replaces the value on the initial row as well. This results in a table where both rows are "bar"
Hi, You are right, there is a problem. This will be fixed in v1.7. Until then, you can go in file Xceed.Words.Net/Src/Container.cs, in method "ReplaceText", and add the following condition before doing the replacement on header and footer: if( this is DocX )
Hi @XceedBoucherS , Is there an estimated release date for version 1.7?
Hi, It won't be long : Spring 2020 or earlier. Thank you.