title: How to bind a combo box list and selection to a dynamic list?
body: <p>Let's say I have a List of strings. In addition to the list, I have an int variable that represents the selection of these strings. So, let's say the list contains {"Option1", "Option2", "Option3", and "Option4"}. This list could shrink or grow dynamically. The int variable could be 0, 1, 2, or 3. If it's 0, then I want "Option1" to be selected. If it's 1, then I want "Option2" to be selected, etc. I have tried doing this:</p>
  
  <pre><code>m_ComboBox.DataSource = m_Configuration.StringList;
  m_ComboBox.DataBindings.Add(new Binding("SelectedIndex", m_Configuration, "SelectionIndex"));
  </code></pre>
  
  <p>This seems dangerous though, because if the index is higher than the amount of strings in the list, then the program will crash because the index is out of range. How can I safeguard against this? Is there a better way to bind a combo box list and selection to a dynamic list?</p>
  
  <p>Also, I would like to convert the values coming in to a more user-friendly format, such as "Option 1", "Option 2", etc. instead of "Option1", "Option2"... Is there an easy way to do this other than having to manually do string manipulation every time the value changes? Is there a way to do this with IValueConverter?</p>