This is a migrated thread and some comments may be shown as answers.

Wrong Text on SelectItem

1 Answer 30 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Oleg Gochachko
Top achievements
Rank 1
Oleg Gochachko asked on 12 Jun 2016, 03:49 AM
<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();
    }
}

1 Answer, 1 is accepted

Sort by
0
Oleg Gochachko
Top achievements
Rank 1
answered on 12 Jun 2016, 04:51 AM

DropDownCollectionView is ListCollectionView

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

Tags
ComboBox
Asked by
Oleg Gochachko
Top achievements
Rank 1
Answers by
Oleg Gochachko
Top achievements
Rank 1
Share this question
or