I'm trying to include multiple rows in a GridView, but it does not add rows, it always overrides the first.
I'd like to know how I can add multiple rows, not replace the first rows.
Follow the code for what I'm currently doing:
dt.Columns.Add("ID");
dt.Columns.Add("Nome");
dt.Columns.Add("Quantidade");
dt.Columns.Add("Valor");
dt.Columns.Add("Desconto");
dt.Columns.Add("Valor Final");
dt.Columns.Add("Quitar", typeof(bool));
DataRow dataRow = dt.NewRow();
dataRow[0] = txtidprodutoAdd.Text;
dataRow[1] = cbProdutoAdd.SelectedItem;
dataRow[2] = UpQuantidade.Text;
dataRow[3] = txtValorAdd.Text;
dataRow[4] = txtDescontoAdd.Text;
dataRow[5] = txtValorFinalAdd.Text;
dataRow[6] = true;
dt.Rows.Add(dataRow);
GridView5.DataSource = dt;
GridView5.DataBind();