Please check an example below, it should give you an idea on how to proceed
xaml
<ListView x:Name="checkList" Height="100" Margin="129,168,187,43">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<CheckBox Content="name" IsChecked="{Binding Checked, Mode=TwoWay}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Elevation" />
<TextBox Text="{Binding Text}" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
you can bind it to the list of objects with Checked and Text properties. Below is an example:
public class CheckBoxListItem
{
public bool Checked { get; set; }
public string Text { get; set; }
public CheckBoxListItem(bool ch, string text)
{
Checked = ch;
Text = text;
}
}
<...>
List<CheckBoxListItem> items1 = new List<CheckBoxListItem>();
items1.Add(new CheckBoxListItem(true, "test1"));
items1.Add(new CheckBoxListItem(false, "test2"));
checkList.ItemsSource = items1;
hope this helps, regards
serge_gubenko
2009-12-02 04:08:10