Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ItemContainerGenerator.IndexFromContainer Method (DependencyObject)

Returns the index to an item that corresponds to the specified, generated UIElement.

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

member IndexFromContainer : 
        container:DependencyObject -> int

Parameters

container
Type: System.Windows.DependencyObject

The DependencyObject that corresponds to the item to the index to be returned.

Return Value

Type: System.Int32
An Int32 index to an item that corresponds to the specified, generated UIElement or -1 if container is not found.

ExceptionCondition
ArgumentException

container is a null reference (Nothing in Visual Basic).

Calling this method is identical to calling the ItemContainerGenerator.IndexFromContainer(DependencyObject, Boolean) method and passing false to the returnLocalIndex parameter.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft