From some Lala, 1 Year ago, written in C#.
Embed
  1.         private void switchItUp()
  2.         {
  3.  
  4.             dynamic[] sortItUp=new dynamic[this.ChosenBox.Items.Count];
  5.  
  6.             //it will still be string here, need to convert
  7.             this.ChosenBox.Items.CopyTo(sortItUp, 0);
  8.  
  9.             //converting
  10.             sortItUp = Array.ConvertAll(sortItUp, new Converter<dynamic, dynamic>(convertIt));
  11.  
  12.             //okay now sortItUp is of type Double lets sort the array
  13.             Array.Sort(sortItUp);
  14.            
  15.             //clear the item list
  16.             //add the newly sorted array to the item list
  17.             //select the first item
  18.             this.ChosenBox.Items.Clear();
  19.             this.ChosenBox.Items.AddRange(sortItUp);
  20.             this.ChosenBox.SetSelected(0, true);
  21.         }
  22.  
  23.         //Delagte for Converter
  24.         private static dynamic convertIt(dynamic it)
  25.         {
  26.             return Convert.ToDouble((string)it);
  27.         }