selecting item from a listbox with checkbox

30 views
Skip to first unread message

Nivas

unread,
Mar 23, 2009, 7:40:05 AM3/23/09
to WPF Graphics Site group
Hi,
I have used a listbox with check box. On submit i need to select the
checked items from the listbox. I couldn't able to get access to the
checkbox.

<ListBox x:Name="listBox" SelectionMode="Multiple">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox x:Name="checkBox"
Margin="0,10,0,0">
<StackPanel Orientation="Horizontal">
<Label x:Name="valueLabel"
FontFamily="Arial" FontSize="20" Content="{Binding Id}" Width="0" />
<Label x:Name="itemLabel"
FontFamily="Arial" FontSize="20" Content="{Binding Name}" />
</StackPanel>
</CheckBox>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
How to loop through the lisbox to get the checked items?
Reply all
Reply to author
Forward
0 new messages