Jump to content

[Resolvido] Editar dados que estão numa datagrid


gregurs
 Share

Recommended Posts

boa noite tenho dois forms um formeditar e outro inserir.

no form editar tenho a datagrid onde me mostra os registos da tabela e tenho tambem um botao "editar" onde tenho este código:

if (this.dataGridView1.RowCount != 0)

{

Apiario a = new Apiario(Convert.ToInt32(dataGridView1["ID", dataGridView1.CurrentRow.Index].Value.ToString()), dataGridView1["Nome", dataGridView1.CurrentRow.Index].Value.ToString(), dataGridView1["Area", dataGridView1.CurrentRow.Index].Value.ToString(), dataGridView1["Proprietario", dataGridView1.CurrentRow.Index].Value.ToString());

ApiarioForm ap = new ApiarioForm();

ap.ShowDialog();

e no forminserir tenho no load

this.apiarioTableAdapter.Fill(this.programacaoDataSet.Apiario);

o problema é que ao fazer editar ele abre o form inserir mas só me mostra o primeiro registo, se quiser editar o segundo registo não consigo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.