Ed Chiu wrote:
Hi,
Is there a way to clone datasource of one datagrid to another?
I tried:
DataGrid2.datasource = DataGrid1.datasource
DataGrid2.Databind()
Does not seem to work
Try using a DataView of your datasource; actually 2 of them, 1 for each
grid. In essence by setting your datasource to a dataset (assuming
that's your original datasource, or even a DataTable), asp.net in the
background creates a dataview for its actual datasource
DataGrid1.Datasource = new DataView(mydataset.Tables(0))
....
DataGrid2.Datasource = new DataView(mydataset.Tables(0))
that should work..
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET