DataGridView Winform c# -


Every time, I press btnAgregar, add "productos" to the list.

Shows the first record of the gridview list for the first time only

After the list grows, but the data grid view does not show only the first record.

  list & lt; Entidades.Productos & gt; ProductosVenta = new list & amp; Product; & Gt; (); Private Zero btnAgregar_Click (Object Sender, EventArgs e) {Entidades.Productos productos = new Entidades.Productos (); Productos = Datos.Productos.ObtenerFormaPagoPorId (Int. Purse (txtId.Text)); ProductosVenta.Add (productos); GVVinta.datsource = Prodovosventa; }  

Creates data source redundant before creating a list of solutions

  ProductosVenta.Add (productos); GvVenta.DataSource = null; // This move does gvVenta.DataSource = ProductosVenta;  

Comments