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? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -