We can easily make any list box as enable to select multiple items in silver light.We just need to set the "SelectionMode" property of that list box below is the example for doing so.
ItemsSource="{Binding Item, ElementName=MainPageView}"
SelectionMode="Multiple">
ListBox.ItemTemplate>
DataTemplate>
StackPanel Orientation="Horizontal" Margin="4">
TextBlock FontWeight="Bold" FontSize="12"
Foreground="#ff005588" Text="{Binding Text}">
/TextBlock>
/StackPanel>
/DataTemplate>
/ListBox.ItemTemplate>
/ListBox>
There are 3 options for the SelectionMode property that are:
Single -> Used to select only one item.
Multiple -> Used to select multiple items using Ctrl or Shift key.
Extended -> Used to select multiple items but here using Shift key you can select items range by just pressing one item, holding Shift and pressing another one.
Hope this is going to help you out... Enjoy!!!!!!
ThanksAnil Kumar PandeyMicorsoft MVP (C#)Navi Mumbai, Maharashtra
this is an interesting silverlight article
ReplyDeleteThanks for the appreciation..
ReplyDelete