I'm adding the gridview fields via code, but the checkbox does not appear, instead of the checkbox, it appears: "System.Web.UI.WebControls.CheckBox"
Here's how I'm doing:
CheckBox check = new CheckBox();
if (Session["dt1"] != null)
{
dt1 = (DataTable)Session["dt1"];
}
else
{
dt1.Columns.Add("ID");
dt1.Columns.Add("Nome");
dt1.Columns.Add("Quantidade");
dt1.Columns.Add("Valor");
dt1.Columns.Add("Desconto");
dt1.Columns.Add("Valor Final");
dt1.Columns.Add("Quitar");
}
dr1 = dt1.NewRow();
dr1["ID"] = txtidprodutoAdd.Text;
dr1["Nome"] = cbProdutoAdd.SelectedItem;
dr1["Quantidade"] = UpQuantidade.Text;
dr1["Valor"] = txtValorAdd.Text;
dr1["Desconto"] = txtDescontoAdd.Text;
dr1["Valor Final"] = txtValorFinalAdd.Text;
dr1["Quitar"] = check;
dt1.Rows.Add(dr1);
GridView5.DataSource = dt1;
GridView5.DataBind();
Session["dt1"] = dt1;
This code works fine when I added the type bool and it was flagged, but now I need the user to have the control mark and uncheck any row in the gridview.