Question

I am using cinch framework v1. I have exposed a public property ( CurrentSuppier )and binded that property to the selecteditem of my combo box .. after I update the , the combobox display doesn't change to the current value of the supplier .. below is some code snippets..

/// <summary>
    /// Current Supplier Record
    /// </summary>
    static PropertyChangedEventArgs currentsupplierChangeArgs =
        ObservableHelper.CreateArgs<IncomingViewModel>(x => x.CurrentSupplier);

    public SupplierModel  CurrentSupplier
    {
        get { return currentsupplier ; }
        set
        {
            currentsupplier = value;

            NotifyPropertyChanged(currentsupplierChangeArgs);

        }
    }

XAML CODE:

  <ComboBox Margin="345,8,542,0" Name="cbosupplier" Height="23" VerticalAlignment="Top" 
          VerticalContentAlignment="Center"
          ItemTemplate="{StaticResource SupplierTemplate}" 
          ItemsSource="{Binding Path=ListofSupplier}"     
          Grid.ColumnSpan="3" Grid.RowSpan="2"
          SelectedItem="{Binding Path=CurrentSupplier ,Mode = TwoWay}"  

I tried binding the CurrentSupplier to a TextBox just to see if the binds works .. and it does .. the textbox gets updated with the current value of my CurrentSupplier property .. but it wont work on the combobox ..

No correct solution

OTHER TIPS

There is a difference between SelectedItem and SelectedValue.

Have you tried to use SelectedValue instead?

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