private void dgvSubjects_DoubleClick(object sender, EventArgs e) { DataGridViewRow selected = dgvSubjects.SelectedRows[0]; int posicion = dgvSubjects.Rows.IndexOf(selected); edit_indice = posicion; Class.Temas auxS = SR[posicion]; txtprecio.Value = Convert.ToDecimal(auxS.Precio); txtdescripcion.Text = auxS.Descripcion; lblAux.Text = Convert.ToString(auxS.Id); btnSubmit.Text = "Modificar"; accion = 1; }