private void Editar_Click(object sender, RoutedEventArgs e) { AlterarCliente alterarCliente_ = new AlterarCliente(); this.NavigationService.Navigate(alterarCliente_); DataRowView rowview = dataGrid.SelectedItem as DataRowView; alterarCliente_.nif2.Text = rowview.Row[0].ToString(); alterarCliente_.nome2.Text = rowview.Row[1].ToString(); alterarCliente_.nTel2.Text = rowview.Row[2].ToString(); alterarCliente_.morada2.Text = rowview.Row[3].ToString(); alterarCliente_.email2.Text = rowview.Row[4].ToString(); }
private void Row_DoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; // Some operations with this row //MessageBox.Show(row.ToString()); AlterarCliente alterarCliente_ = new AlterarCliente(); this.NavigationService.Navigate(alterarCliente_); DataRowView rowview = dataGrid.SelectedItem as DataRowView; alterarCliente_.nif2.Text = rowview.Row[0].ToString(); alterarCliente_.nome2.Text = rowview.Row[1].ToString(); alterarCliente_.nTel2.Text = rowview.Row[2].ToString(); alterarCliente_.morada2.Text = rowview.Row[3].ToString(); alterarCliente_.email2.Text = rowview.Row[4].ToString();; }