none
Listbox not scrolling if inside HeaderedContentControl

    Question

  • Hi, I can get the listbox to scroll, I have my listbox inside a headredContentControl. Below is my code:

    <UserControl x:Class="SilverlightApplication1.Views.xx"
        xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
       >
            <Grid x:Name="LayoutRootMain" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                    <toolkit:HeaderedContentControl Grid.Row="0" FontSize="12" Width="700" 
                                                    Margin="60" 
                                                    Header="Header Title">
                <ListBox Name="EmployeeListBox" Background="Transparent" Margin="40" Grid.Row="0"
                                     SelectionMode="Single"
                                     ItemsSource="{Binding Employees, Mode=TwoWay}"  >
                    <ListBox.ItemTemplate>
                        <DataTemplate >
                            <StackPanel>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="120" />
                                        <ColumnDefinition Width="140" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock  Grid.Column="0" Grid.Row="0" FontWeight="Bold" Text="Name:" />
                                    <TextBlock x:Name="TextBlock1"  Grid.Column="1" Grid.Row="0"  
                                               Text="{Binding Name}" />
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </toolkit:HeaderedContentControl>
            </Grid>
    </UserControl>
    Sunday, March 04, 2012 2:04 AM