how can I sort the destination list when transferring based on the “Text” so it will look something like
A
B
C
Now it seems like the transfer button causes a postback, but i am not sure where to add it and how to sort it since it is being binded in a method like this (the destination listbox)
protected void BindDestinationCollection()
{
StoreItems storeItems =new StoreItems();
DataSet dsStoreItems= storeItems.GetDestinationItemsByID(ItemID);
DataView view = new DataView();
if (dsStoreItems.Tables[0] != null && dsStoreItems.Tables[0].Rows.Count > 0)
{
lstDestinationListBox.Items.Clear();
view = dsStoreItems.Tables[0].DefaultView;
view.Sort = "ItemName ASC";
lstDestinationListBox.DataSource = view;
lstDestinationListBox.DataTextField = "ItemName";
lstDestinationListBox.DataValueField = "ItemID";
lstDestinationListBox.DataBind();
}
}
After transferring the items, in the OnTransferred event handler, use the following code: