This documentation is archived and is not being maintained.

ItemsControl.ItemContainerStyleSelector Property

Enables you to provide custom style-selection logic for a style that can be applied to each generated container element. This is a dependency property.

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

public StyleSelector ItemContainerStyleSelector { get; set; }
/** @property */
public StyleSelector get_ItemContainerStyleSelector ()

/** @property */
public void set_ItemContainerStyleSelector (StyleSelector value)

public function get ItemContainerStyleSelector () : StyleSelector

public function set ItemContainerStyleSelector (value : StyleSelector)

    <StyleSelector .../>

Property Value

A StyleSelector object that contains logic that chooses the style to use as the ItemContainerStyle. The default value is a null reference (Nothing in Visual Basic).

Identifier field


Metadata properties set to true


You use the ItemContainerStyle property to set a style to affect the appearance of the elements that contain the data items. For example, for ListBox, the generated containers are ListBoxItem controls; for ComboBox, they are ComboBoxItem controls. If you have more than one style defined and need to supply logic to choose which one to apply, then you use the ItemContainerStyleSelector property instead of the ItemContainerStyle property. Note that this property is ignored if the ItemContainerStyle property is set.

The ItemsControl provides great flexibility for visual customization, and therefore, provides many styling and templating properties. To affect the layout of the items, you use the ItemsPanel property. If you are using grouping on your control, you can use GroupStyle or GroupStyleSelector. You use the ItemTemplate or the ItemTemplateSelector to specify the visualization of the data objects. For more information about when to specify an ItemTemplate, see Data Templating Overview.

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