Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ItemContainerStyle Property

ComboBox.ItemContainerStyle Property


Gets or sets the style applied to the container generated for each item in the combo box.

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

public Style ItemContainerStyle { get; set; }
<ComboBox ItemContainerStyle="styleReference"/>

XAML Values


A single Style object element.


A StaticResource reference to a Style.

For information that can help you decide whether to define styles inline or as resources, see Inline Styles and Templates.

Property Value

Type: System.Windows.Style
The style applied to the container generated for each item in the combo box.

Dependency property identifier field: ItemContainerStyleProperty

You can use the ItemContainerStyle to provide a custom appearance for combo box items listed in the drop-down portion. This style does not apply to the selected item displayed in the text box.

The following example demonstrates how to set the ItemContainerStyle property to display a custom style for a list of bound combo box items.

public partial class Page : UserControl
    public ObservableCollection<Recording> MyMusic = new ObservableCollection<Recording>();
    public Page()
        MyMusic.Add(new Recording("Sheryl Crow", "Detours", new DateTime(2008, 2, 5)));
        MyMusic.Add(new Recording("Brandi Carlisle", "The Story", new DateTime(2007, 4,3)));
        MyMusic.Add(new Recording("Patty Griffin", "Children Running Through", new DateTime( 2007, 2, 6)));
        MusicCombo.DataContext = MyMusic;

public class Recording
    public Recording(){}
    public Recording (string artistName, string cdName, DateTime release)
        Artist = artistName;
        Name = cdName;
        ReleaseDate = release;
    public string Artist { get; set; }
    public string Name { get; set; }
    public DateTime ReleaseDate {get; set;}

    <Style TargetType="ComboBoxItem" x:Key="musicStyle" >
        <Setter Property="Foreground" Value="Blue" />
        <Setter Property="FontStyle" Value="Italic" />

<ComboBox Height="40" Width="200" x:Name="MusicCombo" 
    ItemContainerStyle="{StaticResource musicStyle}" ItemsSource="{Binding}">
                <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" />
                <TextBlock Text="{Binding Path=Artist}" />


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2015 Microsoft