NativeExcel2 for .Net Developer's Reference

IRangeRows.Item Property (Int32)

Returns an IRangeRow interface that represents a row by using row index number.

[C#] In C#, this property is the indexer for the IRangeRows class.

[Visual Basic]
returnValue = IRangeRowsObject.Item( row );
returnValue = IRangeRowsObject( row );

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.


The one-based index number of the row

Property Value

Returns an IRangeRow interface.


This example changes the format for every second row on sheet one to bold.

 IRangeRows rows = book.Worksheets[1].UsedRange.Rows;
 bool bold = false;
 for (int row = 1; row <= rows.Count; row++) {
     rows[row].Font.Bold = bold;
     bold = !bold;    
 Dim rows As IRangeRows = book.Worksheets(1).UsedRange.Rows
 Dim bold As Boolean = False
 For row As Integer = 1 To rows.Count
    rows(row).Font.Bold = bold
    bold = Not(bold)
 Next row    
 IRangeRows* rows = book->Worksheets->Item[1]->UsedRange->Rows;
 bool bold = false;
 for (int row = 1; row <= rows->Count; row++) {
     rows->Item[row]->Font->Bold = bold;
     bold = !bold;    

See Also

IRangeRows Interface | NativeExcel Namespace | IRangeRows.Item Overload List | IRangeRow Interface