CompositeNodeIndexOf Method
Returns the index of the specified child node in the child node array.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
Syntax
public int IndexOf(
	Node child
)

Parameters

child
Type: Aspose.WordsNode

Return Value

Type: Int32
Remarks
Returns -1 if the node is not found in the child nodes.
Examples
Retrieves the index of a cell in a row.
[C#]

int cellIndex = row.IndexOf(cell);
Examples
Retrieves the index of a row in a table.
[C#]

int rowIndex = table.IndexOf(row);
Examples
Shows how to get the index of a given child node from its parent.
[C#]

Document doc = new Document(MyDir + "Rendering.doc");

// Get the body of the first section in the document.
Body body = doc.FirstSection.Body;
// Retrieve the index of the last paragraph in the body.
int index = body.ChildNodes.IndexOf(body.LastParagraph);
See Also