I want to Exchange SuperGridControl DataItem,But after the exchanged Source not Change,This is My Code:
Section 1, GridRow move to next row code :
GridItemsCollection gridRows = sgcData.PrimaryGrid.Rows;
GridRow activeRow = sgcData.PrimaryGrid.ActiveRow as GridRow;
if (gridRows == null || activeRow.Index == gridRows.Count - 1) return;
GridRow nextGridRow = gridRows[activeRow.Index + 1] as GridRow;
sgcData.PrimaryGrid.Rows[activeRow.Index] = nextGridRow;
sgcData.PrimaryGrid.Rows[nextGridRow.Index] = activeRow;
sgcData.PrimaryGrid.SetActiveRow(activeRow);
Section 2, GridRow move to previous row code :
GridItemsCollection gridRows = sgcData.PrimaryGrid.Rows;
GridRow activeRow = sgcData.PrimaryGrid.ActiveRow as GridRow;
if (gridRows == null || activeRow.Index == 0) return;
GridRow previousGridRow = gridRows[activeRow.Index - 1] as GridRow;
sgcData.PrimaryGrid.Rows[previousGridRow.Index] = activeRow;
sgcData.PrimaryGrid.Rows[activeRow.Index] = previousGridRow;
sgcData.PrimaryGrid.SetActiveRow(activeRow);
Finally, After the exchanged Why source not change ?