Declined
Last Updated: 15 May 2019 14:28 by ADMIN
Philipp
Created on: 03 May 2019 09:42
Category: ComboBox
Type: Bug Report
0
ComboBox: Wrong item is selected on Text binding

The following xaml code

            <telerik:RadComboBox Margin="5"
                                 ItemsSource="{Binding Path=AvailableServices}"
                                 IsEditable="True" 
                                 Text="{Binding Path=Service, Mode=TwoWay}"/>

            <ComboBox Margin="5"
                                 ItemsSource="{Binding Path=AvailableServices}"
                                 IsEditable="True" 
                                 Text="{Binding Path=Service, Mode=TwoWay}"/>

with this view model

public class ViewModel

{ public ObservableCollection<string> AvailableServices { get; set; } = new ObservableCollection<string> { "UPS Standard", "UPS Express Saver", "UPS Express 12:00", "UPS Express" }; public string Service { get; set; } = "UPS Express"; }

produces the attached output. 

 

The standard WPF ComboBox is set to "UPS Express" as expected while the RadComboBox shows "UPS Express Saver" which probably was incorrectly autocompleted. 


Attached Files:
1 comment
ADMIN
Vladimir Stoyanov
Posted on: 10 May 2019 09:05
Hello Philipp,

Thank you for the provided description and sample code.

We are already aware of the described behavior and it is logged in our feedback portal as a bug: ComboBox: In editable mode setting the Text property, will return the first matching element, not the full matching one. You can follow the item in order to get notified for any developments. 

As a workaround for the time being, I can suggest implementing a custom Filtering Behavior and setting the value of the the "matchingIndex" private field of the default filtering behavior to the value of the "fullMatchIndex" field inside the FindFullMatchIndex virtual method. I am attaching the sample project modified to demonstrate what I have in mind.  Note, that I have not tested this approach extensively and you should do so before including it in your application. 

Hope you find this helpful. 

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files: