vijay rags

vijay rags

  • NA
  • 68
  • 163.8k

Re:Scroll bar and multiple select item in ListBox in Silverlight.

Sep 20 2011 6:09 AM
Hi,

    How to add a scroll bar inside the Listbox and handle the multiple Listbox items Selected in silverlight3. I tried with the Following code. Whether we need to give the ListBox inside  a ScrollViewer or. I have given the Scroll Visibility for ListBox but it is not coming.

 <ListBox x:Name="ListBox2" Grid.Row="12" Grid.Column="1" Width="200" Height="500"  ScrollViewer.VerticalScrollBarVisibility="Visible"
                             SelectionMode="Extended" SelectionChanged="ListBox2_SelectionChanged" Margin="10" ItemsSource="{Binding}" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Vertical">
                                    <TextBlock Text="{Binding Name, Mode=TwoWay}" Margin="5" Foreground="Black"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

Thanks,


Answers (4)