I have the following problem with my project:
I have a form 1 where I see tickets that took turns.
When I click on call once the record is selected, it saves the information inside a table.
This other form raises the information at the start of that grid:
My question would be, how can I update the table in form 2 every time I insert data from form 1?
Thanks in advance.
UPDATE.
I have tried with what they mentioned to use a method from form 2 and invoke it and use it in the one, but I still do not get results, the method works since when I use it in form 2 with a Load it just raises, it brings all the data, but when in form 1 I add it to the click-to-call event, it does not update the grid of form 2, if I close it and lift it up again if it brings them. It is necessary that the form 2 always remains open, so it is impossible to close it and open it for each time you need to update the data.
Greetings!
Code in form 2:
public partial class Llamador : Form
{
public Llamador()
{
InitializeComponent();
}
Controles con = new Controles();
public void UpdatearCosas()
{
con.CargarTurnosLlamados(dgvLlamador);
}
'
And this is the code of form 1 invoking the method created before.
'
private void btnLlamar_Click(object sender, EventArgs e)
{
Controles con = new Controles();
TurnosLlamados turnosallamar = new TurnosLlamados();
int idserv = Convert.ToInt32(cmbServicio.SelectedValue);
turnosallamar.Id_Puesto = Convert.ToInt32(cmbPuestos.SelectedValue);
turnosallamar.NroTurno = Convert.ToInt32(this.dgvTurnos.CurrentRow.Cells[1].Value);
con.LlamarTurno(turnosallamar);
int id = Convert.ToInt32(this.dgvTurnos.CurrentRow.Cells[0].Value);
con.CambiarEstado(id);
con.cargargrillaTurnos(dgvTurnos, idserv);
Llamador llama = new Llamador();
llama.UpdatearCosas();
}
But the method still does not work.