I have no idea, why my program crash.
If i click "Reload" Button:
private void reloadBtn_Click(object sender, RoutedEventArgs e)
{
comboFilter.Items.Clear();
dataGridPrivatecustomers.Columns.Clear();
dataGridPrivatecustomers.ItemsSource = null;
load_columns_privatecustomer();
load_values_privatecustomer();
}
All works. But if I select a filter for my search function and click reload, then it crashes:
private void comboFilter_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
labelfilter.Content = "Filter: " + comboFilter.SelectedItem;
filtervalue = comboFilter.SelectedItem.ToString();
}
This is the breakpoint:
filtervalue = comboFilter.SelectedItem.ToString();
And I get a NulLReferenceException Error.
I tryed to make a filtervalue = null;
in reloadBtn_Click but also doesn't work.