RowDefinitionCollection.RemoveAt(Int32) Metoda

Definice

Odebere položku RowDefinition ze zadané pozice indexu RowDefinitionCollection .

public:
 virtual void RemoveAt(int index);
public void RemoveAt(int index);
abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

Parametry

index
Int32

Pozice v kolekci, na které RowDefinition se odebere.

Implementuje

Příklady

Následující příklad ukazuje, jak použít metodu RemoveAt k odebrání RowDefinition na určité RowDefinitionCollectionindex pozici.

private void removeRow(object sender, RoutedEventArgs e)
{
    if (grid1.RowDefinitions.Count <= 0)
    {
        tp1.Text = "No More Rows to Remove!";
    }
    else
    {
        grid1.RowDefinitions.RemoveAt(0);
    }
}
Private Sub removeRow(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If (grid1.RowDefinitions.Count <= 0) Then
        tp1.Text = "No More Rows to Remove!"
    Else
        grid1.RowDefinitions.RemoveAt(0)
    End If
End Sub

Pokud chcete zobrazit úplnou ukázku, podívejte se na postupy: Manipulace se sloupci a řádky pomocí ColumnDefinitionsCollections a RowDefinitionsCollections.

Poznámky

RowDefinitionCollection používá systém indexování založený na nule.

Platí pro

Viz také