private void comboBoxChooseChildUpdate_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (comboBoxChooseChildUpdate.SelectedIndex != -1) { contract = bl.getContract((long)comboBoxChooseChildUpdate.SelectedValue); gridDetalisContract.DataContext = contract; mom = bl.getMother((long)comboBoxchooseMomUPdate.SelectedValue); gridHourMom.DataContext = mom; buttonUpdateContract.IsEnabled = true; buttonUpdateMomhour.IsEnabled = true; } } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }