Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- id = Int32.Parse(dataGridView1.CurrentRow.Cells["id_curso"].Value.ToString());
- row = dataGridView1.CurrentRow.Index;
- datos[0] = dataGridView1.CurrentRow.Cells["titulo"].Value.ToString();//todos los datos del dataGrid y mostrar los datos en los txt correspondientes
- datos[1] = dataGridView1.CurrentRow.Cells["cod_curso"].Value.ToString();
- datos[2] = dataGridView1.CurrentRow.Cells["descripcion"].Value.ToString();
- datos[3] = dataGridView1.CurrentRow.Cells["horas"].Value.ToString();
- datos[4] = dataGridView1.CurrentRow.Cells["id_curso"].Value.ToString();
- txtTitulo.Text = datos[0];
- txtCodcurso.Text = datos[1];
- txtDescripcion.Text = datos[2];
- txtHoras.Text = datos[3];
- }
- catch (System.NullReferenceException) {
- MessageBox.Show("Los datos de este curso estan corruptos y no se pueden visualizar"); }
- }
- Console.WriteLine("DataGridView actualizado");
- var list = await Task.Run(async () =>
- {
- return await _api.ObtenerCursos(string.Empty);
- });
- dataGridView1.DataSource = list;
- dataGridView1.ClearSelection();
- try
- {
- dataGridView1.Rows[row].Cells[0].Selected = true;
- //dataGridView1.Rows[row].Selected = true;
- }
- catch (System.ArgumentOutOfRangeException) { }
- }
Add Comment
Please, Sign In to add comment