Assuming -
i)dtProduseStoc is a datatable which you are passing to FillDataTable() method and
ii)FillDataTable() method is working perfectly fine, and
iii) I also guess dtProduseStoc table is declared globally
do as below -
a)Set the
AutoGenerateColumns of the gridview you want to bind the data to, as
false
b)Then in place of
AfiseazaProduseStoc(false, null);
add a new line as
BindGridview();
c)And at last, implement your BindGridview() method as
void BindGridview()
{
GridviewId.DataSource = dtProduseStoc ;
GridviewId.DataBind();
}
HTH,
Rajeev