I have successfully moved items from one list to another, but there is one display issue, when I move item back from LIST2 to LIST1, then the item is positioned at the end, so I have scroll down to see if it is there or not.
How can I again make the listitems In LIST1 sorted or how to add it back to its original position?
I have written the code in .cs file so no jquery or javascript is required as an option.
This my code to move items in between lists:
if (SelectedInvestorsLst.SelectedIndex > -1)
{
string _value = SelectedInvestorsLst.SelectedItem.Value;
string _text = SelectedInvestorsLst.SelectedItem.Text;
ListItem item = new ListItem();
item.Text = _text;
item.Value = _value;
InstitutionLst.Items.Add(item);
SelectedInvestorsLst.Items.Remove(item);
}
Use the insert method