title: Dynamics AX 2009: How to sort an unbound form control's contents?
body: <p>I was using a <b>Listbox</b> control on a form, and programmatically adding <b>items</b> to it. I thought that if I called the <i>sort(SortOrder::Ascending)</i> method on the <b>Listbox</b> it would do just that -- however, I was wrong.</p>
  
  <p>Ultimately, I am unable to achieve these results. I don't have to use a <b>Listbox</b>, but I need two pieces of functionality:</p>
  
  <ol>
  <li>Programmatically be able to add Strings to the control</li>
  <li>Be able to run code when an item is <i>clicked</i> or <i>selected</i></li>
  <li>The list should be able to be sorted alphabetically</li>
  </ol>