NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

RowsCollection.Item

Gets the row at the specified index.

[C#] In C#, this member is the indexer for the RowsCollection class.

[Visual Basic]
Public Default ReadOnly Property Item( _
   ByVal index As Integer _
) As DataRow
[C#]
public DataRow this[
   int index
] {get;}
[C++]
public: __property DataRow* get_Item(
   int index
);
[JScript]
returnValue = RowsCollectionObject.Item(index);
-or-
returnValue = RowsCollectionObject(index);

[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 Item property whose type is Object and whose index type is String.

Arguments [JScript]

index
The zero-based index of the row to return.

Parameters [Visual Basic, C#, C++]

index
The zero-based index of the row to return.

Property Value

The specified DataRow.

Exceptions

Exception Type Condition
IndexOutOfRangeException There is no row at the specified index.

Remarks

The Contains method is used determine if any rows in the collection contains a specified value.

Example [Visual Basic]

The following example prints the value of column 1 in a DataRow object. The example uses the RowsCollection object's Item property (RowsCollection indexer) to specify which row to print.

[Visual Basic]

Private Sub GetRowAtIndex(i As Integer)
   Dim rc As RowsCollection
   Set rc = DataGrid1.DataGridTable.DataTable.Rows
   Dim row As DataRow
   Set row = rc(DataGrid1.CurrentCell.RowNumber)
   edit1.Text = row(i)
End Sub

See Also

RowsCollection Class | RowsCollection Members | System.Data Namespace | Contains