private void btnBorrarFila_Click(object sender, RoutedEventArgs e) { try { object item = dataGridCustomers.SelectedItem; string ID = (dataGridCustomers.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text; cone.BorrarAlumno(ID); MessageBox.Show("Alumno Eliminado"); //Actualizamos el datagrid mostrarAlumnos(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }