private void btnEditar_Click(object sender, RoutedEventArgs e) { //int _index = dgvCadastro.Items.IndexOf(dgvCadastro.CurrentItem); //DataRowView row = (DataRowView)dgvCadastro.SelectedItems[_index]; DataRowView row = dgvCadastro.SelectedItem as DataRowView; if (row != null) { var A = new ClienteView(); A.IniciaVariavelEdit(Convert.ToInt32(row["ativo"]), Convert.ToString(row["nome"]), Convert.ToString(row["datanacimento"]), Convert.ToString(row["cpfcnpj"]), Convert.ToString(row["telefone"]), Convert.ToString(row["observacoes"]), Convert.ToString(row["id"])); A.IniciaCadastro(); A.Show(); } }
private void btnNovo_Click(object sender, RoutedEventArgs e) { var A = new ClienteView(); A.IniciaVariavelNovo(); A.IniciaCadastro(); A.Show(); }