Hello guys, this is my first question here. I'm getting started with WPF and i am stuck. Here is the problem: I have a ListView as following:
<UserControl.Resources>
<DataTemplate x:Key="FirstCell">
<StackPanel Orientation="Horizontal">
<CheckBox Margin="2"></CheckBox>
</StackPanel>
</DataTemplate>
</UserControl.Resources>
<ListView Name="lvRights">
<ListView.View>
<GridView>
<GridViewColumn Width="100" Header="Select" CellTemplate="{StaticResource FirstCell}"/>
<GridViewColumn Width="200" Header="Right" DisplayMemberBinding="{Binding Path=Name}" />
</GridView>
</ListView.View>
</ListView>
I am binding the list to a collection of "Roles", which have only Id and Name. I am using that DataTemplate to display a checkbox in the first column.
And here is the question:
How can I know at runtime whether the user checked one of the checkboxes? In the .Items property of the listview i have the Roles, but i cannot get any information about the first column.
I have the feeling this is SOO simple, but somehow i am missing the answer.
10x in advance.