Export (0) Print
Expand All

RowDefinitionCollection.Contains Method

Determines whether a given RowDefinition exists within a RowDefinitionCollection.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)

public bool Contains (
	RowDefinition value
)
public final boolean Contains (
	RowDefinition value
)
public final function Contains (
	value : RowDefinition
) : boolean
You cannot use methods in XAML.

Parameters

value

Identifies the RowDefinition that is being tested.

Return Value

true if the RowDefinition exists within the collection; otherwise false.

The following example demonstrates how to use the Contains method to determine whether a RowDefinition exists in a RowDefinitionCollection.

private void containsRow(object sender, RoutedEventArgs e)
{
    if (grid1.RowDefinitions.Contains(rowDef1))
    {
        tp2.Text = "Grid Contains RowDefinition rowDef1";
    }
    else
    {
        tp2.Text = "Grid Does Not Contain RowDefinition rowDef1";
    }
}

To view the complete sample, see Manipulate Columns and Rows using ColumnDefinitionsCollections and RowDefinitionsCollections.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft