We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can a an entire row be deleted if it has null values?

I am looking at a scenario where there are mutliple rows in a table which are obtained as a result of multiple elements in the datasource. But, in a row, the all the values are blank or null. Is there a possibility for this row with null values to be deleted programmatically? Is there a method like deleteRow() which can do this?
Thanks in Advance!
Pavithra V S


Thanks for your inquiry. You can remove any node from the document. There is method Node.Remove(), which removes the node. For example see the following code:

// Open document.
Document doc = new Document(@"Test001\in.doc");
// Get some row (in this case I get row,where some bookmark is located).
Node row = doc.Range.Bookmarks["mybk"].BookmarkStart.GetAncestor(NodeType.Row);
// Remove row.
if (row != null)
// Save ouput document.

Hope this helps.
Best regards.