DataRowCollection.RemoveAt(Int32) Yöntem
Tanım
Belirtilen dizindeki satırı koleksiyondan kaldırır.Removes the row at the specified index from the collection.
public:
void RemoveAt(int index);
public void RemoveAt (int index);
member this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)
Parametreler
- index
- Int32
Kaldırılacak satırın dizini.The index of the row to remove.
Örnekler
Aşağıdaki örnek, yöntemini çağırarak bir içindeki son satırı kaldırır DataRowCollection RemoveAt .The following example removes the last row in a DataRowCollection by calling the RemoveAt method.
Private Sub RemoveRowByIndex()
Dim table As DataTable = CType(DataGrid1.DataSource, DataTable)
Dim rowCollection As DataRowCollection = table.Rows
If rowCollection.Count = 0 Then
Exit Sub
End If
rowCollection.RemoveAt(rowCollection.Count - 1)
End Sub
Açıklamalar
Bir satır kaldırıldığında, bu satırdaki tüm veriler kaybolur.When a row is removed, all data in that row is lost. Ayrıca, Delete DataRow bir satırı kaldırma için işaretlemek üzere sınıfının metodunu çağırabilirsiniz.You can also call the Delete method of the DataRow class to just mark a row for removal. Çağırma, RemoveAt
Delete ve ardından çağırma ile aynıdır AcceptChanges .Calling RemoveAt
is the same as calling Delete and then calling AcceptChanges.
ClearTek seferde koleksiyonun tüm üyelerini kaldırmak için yöntemini kullanabilirsiniz.You can use the Clear method to remove all members of the collection at one time.