I am working on a Openxml Excel Processing project. In a certain class I have the Row object.
Can I get the current Spreadsheet of this Row object using only Row object?
I am working on a Openxml Excel Processing project. In a certain class I
Share
You could use the
Parentproperty of yourRowinstance tonavigate to the
Worksheetthe row belongs to.The following MSDN article on the Row class clearly says that the only parent element
of a
Rowinstance is theSheetDataobject the row belongs to.The only possible Parent object of the
SheetDataobject is theWorksheetinstance (please see the following MSDN article on the SheetData class for more information).Example:
The following example shows how to navigate to the
Worksheeta given
Rowinstance belongs to. For convenience I’ve createda extension method: