Search code examples
silverlight-3.0dataform

Populate DataFormComboBoxField from a list


Does anyone know how to populate a DataFormComboBoxField from a regular list in SilverLight 3 beta? There seems to be no meaningful documentation or examples anywhere online.

Thanks ~Steve


Solution

  • Actually it turned out to be as simple as

    private void dfEmailForm_Loaded(object sender, RoutedEventArgs e)
    {
    DataFormComboBoxField dfc = new DataFormComboBoxField();
    dfc.ItemsSource = new List<string>() { "Type A", "Type B" };
    dfc.ItemsSource = lstEmailType;
    }
    

    but it does have to the in the Loaded area for the dataform.