CellParentRow Property

Returns the parent row of the cell.

Namespace:  Aspose.Words.Tables
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public Row ParentRow { get; }

Property Value

Type: Row
Remarks
Equivalent to (Row)FirstNonMarkupParentNode.
Examples
Shows how to set a table to stay together on the same page.
// To keep a table from breaking across a page we need to enable KeepWithNext 
// for every paragraph in the table except for the last paragraphs in the last 
// row of the table
foreach (Cell cell in table.GetChildNodes(NodeType.Cell, true).OfType<Cell>())
foreach (Paragraph para in cell.Paragraphs.OfType<Paragraph>())
{
    // Every paragraph that's inside a cell will have this flag set
    Assert.True(para.IsInCell);

    if (!(cell.ParentRow.IsLastRow && para.IsEndOfCell))
        para.ParagraphFormat.KeepWithNext = true;
}
See Also