There are basically 2 types of information you will need to copy. One is the actual data, and the other are things stored in the GridModel like ColWidths, etc.
To copy the GridModel, you can serialize it to a memorystream and then create a new instance from the serialized data.
System.IO.MemoryStream s = new System.IO.MemoryStream();
oldGrid.SaveBinary(s);
GridControl newGrid = new GridControl(GridModel.LoadBinary(s));
s.Close();
The quickest way to handle teh actual data is to do it directly through your external datasource, and not try to use the oldGrid. The reason is that if you go through the oldGrid and use an indexer on this grid to retrieve the data, events (such as QueryCellInfo that actually gets the data) will be raised. If you access your datasource directly, then these events will be avoided which normally makes things much faster.
To put the data into your new grid, if your datasource is something recognized by the grid.PopulateValues method, you should use that method. If not, you can loop through your datasource and call grid.SetCellInfo to set the values into the grid. Make sure you use the overload that has dontRaiseSaveCellInfo and pass this as true. Or, you can just directly set the values into the GridData object yourself.
newGrid.RowCount = rowsInDataSource;
newGrid.ColCount = colsInDataSource;
for(int row = 1; row <= rowsInDataSource; row++)
{
for(int col = 1; col <= colsInDataSource; col++)
{
object o = GetValueFromYourDataSource(row, col);
if(o != null)
{
GridStyleInfo style = new GridStyleInfo();
style.CellValue = o;
newGrid.Data[row, col] = style.store;
}
}
}
newGrid.Refresh();