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.Remove (Int32)

Removes the row with the specified index from the collection.

[Visual Basic]
Overloads Public Sub Remove( _
   ByVal index As Integer _
)
[C#]
public void Remove(
   int index
);
[C++]
public: void Remove(
   int index
);
[JScript]
public function Remove(
   index : int
);

Parameters

index
The index of the row to remove.

Exceptions

Exception Type Condition
IndexOutOfRangeException No row corresponds to the given value.

Remarks

When a row is removed, data in that row is lost.

You can also use the Clear method to remove all members of the collection at once.

Example [Visual Basic]

The following example removes the last row in a RowsCollection by calling the Remove method.

[Visual Basic]

Private Sub RemoveRowByIndex()
   Dim t As DataTable
   Dim rc As RowsCollection
   Dim foundRow As DataRow
   Set t = DataGrid1.DataGridTable.DataTable
   Set rc = t.Rows
   If rc.Count = 0 Then Exit Sub
   rc.Remove rc.Count - 1
End Sub

See Also

RowsCollection Class | RowsCollection Members | System.Data Namespace | RowsCollection.Remove Overload List | Clear | Add