I have the following code to print a ticket, but it marks me an error in the dataGridView1, the error is as follows (the name dataGridview1 does not exist in the current context) foreach (DataGridViewRow row in dataGridView1.Rows) marks it after I write the foreach
CreateTicket ticket = new CreateTicket ();
ticket.TextoIzquierda(" ");
ticket.TextoCentro("TICKET CIERRE DE CAJA");
ticket.TextoIzquierda(" ");
ticket.TextoExtremos("FECHA : " + txtFechaV.Text, "HORA : " + txtHora.Text);
ticket.TextoIzquierda(" ");
ticket.EncabezadoVenta();
ticket.lineasGuio();
foreach (DataGridViewRow fila in dataGridView1.Rows)
{
ticket.AgregaArticulo(fila.Cells[1].Value.ToString(), int.Parse(fila.Cells[0].Value.ToString()), decimal.Parse(fila.Cells[3].Value.ToString()));
}