Home Forums WinForms controls Xceed Grid for WinForms Moving Rows Reply To: Moving Rows

User (Old forums)
Member
Post count: 23064

Our application also needed such functionality. What we did: swap the <b>content</b> of the rows, instead of the rows.<pre>private static void SwapRows(CellRow a, CellRow b) {
int count = a.Count;
for(int i=0; i<count; i++) {
Cell cellA = a.Cells[i];
Cell cellB = b.Cells[i];
object dummy = cellA.Value;
cellA.Value = cellB.Value;
cellB.Value = dummy;
}
}</pre>

Imported from legacy forums. Posted by Tommy (had 2874 views)