开发者

WPF using CINCH SelectedItem COMBOBOX

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(currentsupplierChangeAr开发者_C百科gs);

        }
    }

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 ..


There is a difference between SelectedItem and SelectedValue.

Have you tried to use SelectedValue instead?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜