what is the fastest way to copy an existing datarow? I did not find any existing methods for this, so currently I add a new row and copy all cells from the source row, but I guess there is a faster method…?
Imported from legacy forums. Posted by Kai (had 1825 views)
for(int i=0; i<count; i++) newCells[i].Value = existingCells[i].Value; // END CODE
Is your current method too slow for your application? Don’t try to optimize if it goes fast enough. If you need to do this a lot, like inside a loop, and this method is too slow, it might be better to work on the underlying DataSource directly. If the DataSource of your grid is a DataTable, it might be better to do it like this:
// START CODE Xceed.Grid.DataRow existingRow = …; // the existing row you want to copy