hi! i have a listbox binded to a list. the list contains checkboxes binded to a field/member of the list. what i want to achieve is that i want to delete the data from list when it's corresponding checkbox is checked...
here's my xaml code:
<ListBox Name="ListBox1" ItemsSource="{Binding histList, Mode=OneWay}" Margin="10,10,10,10" Height="197" VerticalAlignment="Center" >
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Content="{Binding FilterName, Mode=TwoWay}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
here's the code in the .cs file
namespace ReportsUIScreens
{
public partial class EditStyle : ChildWindow
{
private List<filterHistory> histList;
public EditStyle(List<filterHistory> histListLink)
{
InitializeComponent();
histList = histListLink;
this.ListBox1.ItemsSource=histList;
}
private void OKButton_Click(object sender, RoutedEventArgs e)
{
//HERE'S WHERE I WANT TO DELETE
this.DialogResult = true;
}
.........
.........
.........
}
}
please help me...