GridViewComboBoxColumn editing with Autocomplete wrong behaviour

2 posts, 0 answers
  1. Shirly
    Shirly avatar
    4 posts
    Member since:
    Apr 2013

    Posted 08 Jan 2014 Link to this post

    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>
  2. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 13 Jan 2014 Link to this post

    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 >>
  3. DevCraft banner
Back to Top