I am working on winrt phone 8.1 project.
I have this combobox.
<ComboBox PickerFlyoutBase.Title=" " Name="ModelComboBox" x:Uid="ModelComboBox" DisplayMemberPath="vcModel" IsEnabled="False" />
And just use this code to in selection change event of combo box that is above that combobox.
private void MakeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (MakeComboBox.SelectedValue != null)
{
List<stbModel> Model = CrudOperations.GetModelById((MakeComboBox.SelectedValue as stbMake).siMakeId);
if (Model != null && Model.Count > 0)
{
ModelComboBox.IsEnabled = true;
ModelComboBox.ItemsSource = Model.OrderBy(x => x.vcModel);
ModelComboBox.SelectedIndex = 0;
}
}
}
Now problem is that, I don't know why whenever I select first item from that combobox it shows nothing in combo box while if I select any item other than first then it shows in combobox.
I can attach screenshot if you need.