<c1:C1ComboBox x:Name="cmb1" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100" Height="20" IsEditable="True" SelectedValueChanged="cmbWellNumber_SelectedValueChanged"/>
List<string> list = new List<string>() { "北京","上海","广州" };
ob1 = new ObservableCollection<string>(list);
cmb1.ItemsSource = ob1;
给C1ComboBox 设置默认值,通过SelectedValue、SelectedIndex、SelectedItem都不行,均提示异常。
cmbWellNumber.SelectedIndex = 0;
如何给C1ComboBox 设置默认值?
|