Wrong Text on SelectItem

2 posts, 0 answers
  1. Oleg Gochachko
    Oleg Gochachko avatar
    2 posts
    Member since:
    Jan 2010

    Posted 11 Jun Link to this post

    <telerik:RadComboBox
                Grid.Column="0"
                ItemsSource="{Binding Path=DropDownCollectionView}"
                IsSynchronizedWithCurrentItem="True"
                DisplayMemberPath="Code" IsEditable="True"
                EmptyText="Code"
                SelectedItem="{Binding Path=Container.Data, Mode=TwoWay}"
                Width="75" VerticalAlignment="Top">
        <i:Interaction.Behaviors>
            <wpf:RadComboBoxClearTextOnLostFocusWhenSelectedItemIsNull />
        </i:Interaction.Behaviors>
    </telerik:RadComboBox>

     

    For some reason after set Container.Data ComboBox Text has Object.ToString() value rather than the Object.Code property value however items of combobox dispay proper values.

    public TData Data
    {
        get { return _data; }
        set
        {
            if (_data == value) return;
            _data = value;
            RaisePropertyChanged();               
        }
    }
     
    public TContainer Container
    {
        get { return _container; }
        private set
        {
            if (_container == value) return;
            _container = value;
            RaisePropertyChanged();
        }
    }
  2. Oleg Gochachko
    Oleg Gochachko avatar
    2 posts
    Member since:
    Jan 2010

    Posted 11 Jun Link to this post

    DropDownCollectionView is ListCollectionView

    And this strange bug happens only if ListCollectionView.Filter is present even if filter result is always true ( "return true;" )

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top