public void MoveDown() { int index = this.lstSelected.SelectedIndex; int newindex = index + 1; DataTable dtSelect = (DataTable)this.lstSelected.DataSource; DataRow dr = dtSelect.Rows[index]; dtSelect.Rows.Remove(dr); dtSelect.Rows.InsertAt(dr, newindex); }this removes the item at index 0 just fine. But the select doesn't happen and there is a blank line at the bottom of the list.
public void MoveDown() { int index = this.lstSelected.SelectedIndex; int newindex = index + 1; DataTable dtSelect = (DataTable)this.lstSelected.DataSource; DataRow dr = dtSelect.Rows[index]; DataRow drNew = dtSelect.NewRow(); foreach(DataColumn dc in dtSelect.Columns) drNew[dc.ColumnName] = dr[dc.ColumnName]; dtSelect.Rows.Remove(dr); dtSelect.Rows.InsertAt(drNew, newindex); } this variation removed the selected item and added it at the end of the list rather than at new index. I tried various permutations of this code and could get nothing to work. Any suggestions?