[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Silverlight Listbox ItemsSource Error

Asked by ALawrence007 in WPF and Silverlight, Microsoft Visual Basic.Net, Visual Studio

Tags: Visual Studio 2008, Silverlight

Hi to all,

I created a Silverlight Listbox application that displays images of the members in my database. I added the Controls toolkit found on codeplex:
http://www.codeplex.com/Wiki/View.aspx?ProjectName=Silverlight

All was working until I added the toolkit and set the ItemsTemplate to Wrap Panel. I then get the following Error:
Items collection must be empty before using itemssource.

When I remove the following line all works fine again:
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<controlsToolkit:WrapPanel Width="Auto">
</controlsToolkit:WrapPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>

Can someone please let me know what I am doing wrong?

Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
<ListBox x:Name="MemberList"
                 ItemTemplate="{StaticResource MembersTemplate}"
                 Background="{StaticResource DefaultedBorderBrush}" 
                 VerticalAlignment="Stretch" 
                 d:LayoutOverrides="VerticalAlignment" 
                 Grid.Row="1"
                 ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <controlsToolkit:WrapPanel Width="Auto">
                    </controlsToolkit:WrapPanel>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
 
Data Template:
<DataTemplate x:Key="MembersTemplate">
            <Grid x:Name="MainGrid" Height="177" Width="356">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="134"/>
                    <ColumnDefinition Width="0.5*"/>
                    <ColumnDefinition Width="0.5*"/>
                </Grid.ColumnDefinitions>
                <Grid Margin="0,0,0,0" Grid.Column="1" x:Name="NameGrid" Grid.ColumnSpan="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.215*"/>
                        <RowDefinition Height="0.282*"/>
                        <RowDefinition Height="0.249*"/>
                        <RowDefinition Height="0.254*"/>
                    </Grid.RowDefinitions>
                    <TextBlock VerticalAlignment="Stretch" Text="{Binding Path=AccountNumber}" TextWrapping="Wrap" Margin="0,0,0,0" FontSize="22" Foreground="#FFFFFFFF" x:Name="FullNameTxt"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Stretch" Text="{Binding Path=FirstName}" TextWrapping="Wrap" Grid.Row="1" Margin="0,0,0,8" FontSize="16" Foreground="#FFFFFFFF" x:Name="AccountTxt" Width="109"/>
                    <TextBlock Text="{Binding Mode=OneWay, Path=LastName}" TextWrapping="Wrap" Margin="0,8,0,0" FontSize="16" Foreground="#FFFFFFFF" x:Name="LastName" HorizontalAlignment="Right" Width="109" Grid.Row="1"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Path=PhoneNumber}" TextWrapping="Wrap" x:Name="PhoneTXT" Grid.Row="2" Foreground="#FFFFFFFF" FontSize="16"/>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Stretch" Text="{Binding Path=MemberID}" TextWrapping="Wrap" x:Name="MemID" Grid.Row="3" Margin="0,0,0,8" Visibility="Collapsed"/>
                </Grid>
                <Border CornerRadius="2" BorderBrush="#FFFCF7" Padding="2" BorderThickness="2" x:Name="ImageBorder">
                    <Image Source="{Binding Converter={StaticResource MyConverter}, Path=ImageContent}" />
                </Border>
            </Grid>
        </DataTemplate>
[+][-]09/01/09 04:14 AM, ID: 25230284Accepted Solution

Your question has an Asker Certified™ answer! ALawrence007 verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zones: WPF and Silverlight, Microsoft Visual Basic.Net, Visual Studio
Tags: Visual Studio 2008, Silverlight
Sign Up Now!
Solution Provided By: ALawrence007
Participating Experts: 1
Solution Grade: A
 
[+][-]08/31/09 05:52 PM, ID: 25227740Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/03/09 06:42 AM, ID: 25250544Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/03/09 08:21 AM, ID: 25251604Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100215-EE-VQP-121 - Hierarchy / EE_QW_3_20080625