Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7176827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:35:14+00:00 2026-05-28T16:35:14+00:00

I am trying to set a border to each item from a items control.

  • 0

I am trying to set a border to each item from a items control. Following is my XAML code. But this doesn’t work.

<ItemsControl.ItemContainerStyle>
    <Style>
        <Setter Property="Control.BorderThickness" Value="5" />
        <Setter Property="Control.BorderBrush" Value="Black" />
    </Style>
</ItemsControl.ItemContainerStyle>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:35:15+00:00Added an answer on May 28, 2026 at 4:35 pm

    The container in an ItemsControl is a ContentPresenter which is not a control, this style will not do anything. You could create an ItemsTemplate containing a Border.

    Alternatively you can change the ContentTemplate in the ItemContainerStyle:

    <ItemsControl.ItemContainerStyle>
        <Style TargetType="ContentPresenter">
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Border BorderBrush="Black" BorderThickness="5">
                            <ContentPresenter Content="{Binding}"/>
                        </Border>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </ItemsControl.ItemContainerStyle>
    

    (Note: This is a real alternative in the sense that it does the exact same thing, so i would use the ItemTemplate as it is a lot less verbose, saves you three tags (Style, Setter, Setter.Value))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to set up a menu so that I have border-left on each menu
I trying to set rounded border for Blackberry Bitmap field.But it is not working
In MonoTouch I am trying to set the border color, but the BorderColor is
When trying to set DoMatchParen I get the following error: E492: Not an editor
Im trying to set up my app to work with authlogic.. the thing is,
http://jsfiddle.net/jasondavis/Mt87G/1/ I am trying to do an un-ordered list, each list item will have
Example: http://jsfiddle.net/xUrDc/ I'm trying to surround each li with a border exactly one pixel
I'm trying to use pygtk in Python but when I try running my code
I am trying to set padding of a StackPanel but there ain't such property.
Hey, I'm currently trying to extract information from a 3d array, where each entry

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.