gridview does not bind datatable copy in C# -


i trying bind copy of datatable gridview, not display it. here sample code:

var clonedata = originaldata.clone(); gvtable.datasource = clonedata; gvtable.databind(); 

if bind originaldata instead of clonedata, works.. what's wrong copy?

asp.net c#.

you need use copy() instead of clone()

both copy , clone methods create new datatable same structure original datatable. new datatable created copy method has same set of datarows original table, new datatable created clone method not contain datarows.

source


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -