Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ItemContainerTemplateSelector.SelectTemplate Method (Object, ItemsControl)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

When overridden in a derived class, returns an ItemContainerTemplate based on custom logic.

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

public virtual DataTemplate SelectTemplate(
	object item,
	ItemsControl parentItemsControl


Type: System.Object

The object for which to select the template.

Type: System.Windows.Controls.ItemsControl

The container for the items.

Return Value

Type: System.Windows.DataTemplate

The template. The default implementation returns null.

.NET Framework
Available since 4.5
Return to top
© 2017 Microsoft