private void InvoiceDG_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (InvoiceDG.SelectedItem != null) { FC_Invoice SelectedInvoice = (FC_Invoice)InvoiceDG.SelectedItem; ContractsPreInvouce.ItemsSource = PlannerClass.GetContracts_PreInvoice(SelectedInvoice); } }