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

GridViewComboBoxColumn editing with Autocomplete wrong behaviour

1 Answer 98 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Shirly
Top achievements
Rank 2
Shirly asked on 08 Jan 2014, 11:56 AM
I'm using RadGridView sample you have been provided called "209935_editablecomboingridviewaddingitems-sl"

I'm trying to add the string "C,M" to the combo box but if i'll press enter the selected item "C,M,Y,K" will be set, and not the new item I want to add.
How can I solve this issue???

 

<UserControl.Resources>
        <local:MyConverter x:Key="MyConverter" />
        <Style  x:Name="myStyle" TargetType="telerik:RadComboBox">
            <Setter Property="OpenDropDownOnFocus" Value="True"/>
            <Setter Property="IsFilteringEnabled" Value="True" />
            <Setter Property="CanAutocompleteSelectItems" Value="False" />
        </Style>
  
    </UserControl.Resources>
  
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewComboBoxColumn UniqueName="MyNumber" IsComboBoxEditable="True" 
                                                DataMemberBinding="{Binding MyNumber, Converter={StaticResource MyConverter}}" />
  
                <telerik:GridViewComboBoxColumn UniqueName="MyString" IsComboBoxEditable="True" EditorStyle="{StaticResource myStyle}"
                                                DataMemberBinding="{Binding MyString}" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 13 Jan 2014, 09:33 AM
Hi Shirly,

What you need to do is to manually set the SelectedItem of the ComboBox right after the new Item is added. This way you will be able to avoid that behavior. I found the mentioned project and modified it in order to achieve the desired scenario, please check the attachment.

Hope this work for you.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ComboBox
Asked by
Shirly
Top achievements
Rank 2
Answers by
Kalin
Telerik team
Share this question
or