Question

With the below binding in XAML, the selected item is not displayed in a combobox (specifically, the current type is not displayed for a site). We are using the caliburn micro framework and DevForce Ideablade. MySite is an Ideablade entity.

<ComboBox Grid.Column="3" Grid.Row="3" 
          ItemsSource="{Binding MySiteTypes}"
          DisplayMemberPath="description"
          SelectedItem="{Binding MySite.SiteType, Mode=TwoWay}"
          SelectedValuePath="description"/>

Code in the ViewModel:

    private BindableCollection<SiteType> _mySiteTypes;
    public BindableCollection<SiteType> MySiteTypes
    {
        get { return _mySiteTypes; }
        set { _mySiteTypes = value; NotifyOfPropertyChange(() => MySiteTypes); }
    }

Once I set the site type with the combobox (the types are present in the dropdown), it correctly displays the type and changes the type in the database. What am I missing, why doesn't it want to display the existing type the first time?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top