How to do a Reset in a C # .aspnet GridView?

0

I have two different tables ( DataTable ) and need to use them in the same Gridview . But when I call Gridview on the screen it always assumes the value of the first table.

Does anyone know how to make a Gridview that fits any query?

dt = info.RetornaInfo(x,y);
GdvInfo.DataSource = dt;
GdvInfo.DataBind();
    
asked by anonymous 17.11.2016 / 15:04

1 answer

2

You will need to set DataSource to null and then clear the DataGridView lines.

GdvInfo.DataSource = null;
GdvInfo.Rows.Clear(); 

dt = info.RetornaInfo(x,y);
GdvInfo.DataSource = dt;
GdvInfo.DataBind();

Previous response removed.

    
17.11.2016 / 16:10