The problem i\'m stuck with is related to checkbox in DataGrid(WPF). I\'ve attached th
//this event is for **Checked and UnChecked** of up check box (cbxall)
private void UpCheckbox_Checked(object sender, RoutedEventArgs e)
{
//checkBox1 = cbxall (your up checkbox)
if (checkBox1.IsChecked == true)
{
dataGrid1.Items.OfType().ToList().ForEach(x => x.IsChecked = true);
}
else
{
dataGrid1.Items.OfType().ToList().ForEach(x => x.IsChecked = false);
}
}
//this event is for all other check box
//**Checked and UnChecked** of all other check box is this event
private void OtherCheckbox_Checked(object sender, RoutedEventArgs e)
{
//checkBox1 = cbxall (your up checkbox)
if (dataGrid1.Items.OfType().All(x => x.IsChecked == true))
{
checkBox1.IsChecked = true;
}
else if (dataGrid1.Items.OfType().All(x => x.IsChecked == false))
{
checkBox1.IsChecked = false;
}
else
{
checkBox1.IsChecked = null;
}
}