Skip to main content

Microsoft Silverlight

Answered Question ListBoxItem Border VisibilityRSS Feed

(0)

tzatcha
tzatcha

Member

Member

4 points

12 Posts

ListBoxItem Border Visibility

As I've been going through Scott Gu's Tutorial series (Part 5) I noticed his screen shots show the border with all the listitems. However when I write the code (Silverlight 2.0) and run it, I have no borders and just white background. So I end up with no separtation between items. What am I missing?

http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-5-using-the-listbox-and-databinding-to-display-list-data.aspx

SLMonster
SLMonster

Member

Member

299 points

65 Posts

Re: ListBoxItem Border Visibility

You need to create template for ListBoxItem see example below

<ListBox x:Name="My_ListBox" Width="425" >
    <ListBox.ItemTemplate>
       
<DataTemplate >
             <Border BorderThickness="1" CornerRadius="3" >
                <StackPanel>
                    <!--TextBlock or any control for Item Template-->
                </StackPanel>
             </Border >         
       
</DataTemplate >
   </ListBox.ItemTemplate>
</ListBox >

Cheers, Mahesh

TomBeeby
TomBeeby

Participant

Participant

1151 points

188 Posts

Answered Question

Re: ListBoxItem Border Visibility

I responded to your question in the "Getting Started" forum

http://silverlight.net/forums/t/107704.aspx

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities