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

In Edit Mode, prevent the Combobox from updating the source

11 Answers 166 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ben Boger
Top achievements
Rank 1
Ben Boger asked on 30 Jun 2011, 04:56 PM
I have a scenario where I would like to use the combobox and its autocomplete functionality however I want to bind the text to a property. I don't want that property to update everykeystroke, surely there is a way to change the way this is updating so I can have autocomplete and only update at the end, leave focus maybe.

I've look at the documentation and I didn't see anything describing this, maybe I just missed it. If thats the case I would love to be pointed in the right direction

thanks in advance,


11 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 Jul 2011, 01:46 PM
Hi Ben,

Please try setting CanAutocompleteSelectItems property of the ComboBox to false and StaysOpenOnEdit and OpenDropDownOnFocus to true, also bind SelectedItem property instead of Text - it will be updated when the item is selected with "Enter" or with the mouse:

<telerik:RadComboBox Width="200" x:Name="radComboBox"
                        IsEditable="True"
                        ItemsSource="{Binding Source={StaticResource DataSource}, Path=Items}"
                        DisplayMemberPath="Name"
                        CanAutocompleteSelectItems="false"
                        StaysOpenOnEdit="True"
                        OpenDropDownOnFocus="True"                        
                        SelectedItem="{Binding Source={StaticResource DataSource}, Path=SelectedItem, Mode=TwoWay}"                               
                        />

Hope this helps.

Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ben Boger
Top achievements
Rank 1
answered on 01 Jul 2011, 04:13 PM
The one thing I didn't try was using the SelectedItem that doesn't seem to make a difference. I am curious, when I was trying to get this working I had run across this post that says the StaysOpenOnEdit is not used has this changed since this post ?
0
Yana
Telerik team
answered on 05 Jul 2011, 03:26 PM
Hi Ben,

StaysOpenOnEdit is not marked as obsolete yet,  but you're right that it's not needed.  I'm sorry for my confusion.

I've attached our test project and a short video showing that the described approach works as expected at our side. Could you please check them and let us know what is different in your case?

Greetings,
Yana
the Telerik team
Register for the Q2 2011 What’s New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
0
Ben Boger
Top achievements
Rank 1
answered on 05 Jul 2011, 03:50 PM
I just downloaded and tried your demo, I'll give you credit, it does work the very first time for updating. however, if you submit you choice and then change it , it seems to actually go back to updating every keystroke as mentioned before. For me, this is inconsistent and an undesired result.
0
Yana
Telerik team
answered on 08 Jul 2011, 01:54 PM
Hello Ben,

Can you please confirm that you're using Q1 2011 SP1 version of the RadControls?  Also can you send us a short video showing the problem? Thanks in advance

Greetings,
Yana
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ben Boger
Top achievements
Rank 1
answered on 08 Jul 2011, 02:28 PM
I am currently using 2011 SP1. Maybe I'm not stating the problem clearly enough.

1. Start the project, click in the combobox and starttyping something that would be in the list. At this point everything should be working well.
2. To Submit a choice, hit enter. First time through this works nicely, the selected item doesn't get updated until the very end.

3. click back into the project and start typing. At this point you should be able to notice the SelectedItem getting updated every keystroke.
0
Yana
Telerik team
answered on 14 Jul 2011, 09:09 AM
Hi Ben,

The SelectedValue of the RadComboBox is updated on every keystroke when the dropdown is closed - is this the situation that you're describing?  Currently this is the default behavior of the ComboBox, but we'll consider changing it.

Best wishes,
Yana
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ben Boger
Top achievements
Rank 1
answered on 14 Jul 2011, 02:55 PM
I just want the option of choosing my mode of update.
0
Yana
Telerik team
answered on 15 Jul 2011, 08:06 AM
Hello Ben,

Thank you for sending this feature request, it will definitely be considered for the upcoming releases of RadComboBox.

Regards,
Yana
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Michael
Top achievements
Rank 1
answered on 20 Dec 2011, 04:31 PM
Hello,

Has there been an update to this, or is there any other way of NOT updating the source with each keystroke when the autocomplete dropdown is not open?

I have a RadGridView with a column as below, and the bindings are working however the source is updated with each keystroke and I want it only updated when the user finishes editing.

<telerik:GridViewDataColumn Header="Axis" Width="*" DataMemberBinding="{Binding Axis, Mode=TwoWay}"

CellStyle="{StaticResource NormalCellStyle}" >
<telerik:GridViewColumn.CellEditTemplate>
  <DataTemplate>
   
<telerik:RadComboBox x:Name="AxisCB" ItemsSource="{Binding Source={StaticResource AxisListViewSource}}" Text="{Binding Path=Axis, Mode=TwoWay}" 
EmptyText="" IsEditable="True" >
    </telerik:RadComboBox>
  </DataTemplate>
</telerik:GridViewColumn.CellEditTemplate>
</telerik:GridViewDataColumn>


0
Yana
Telerik team
answered on 21 Dec 2011, 09:54 AM
Hi Michael,

I am afraid that the behavior is not changed and the value is still updated on every keystroke when the dropdown is closed. We're sorry for the inconvenience.

All the best,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ComboBox
Asked by
Ben Boger
Top achievements
Rank 1
Answers by
Yana
Telerik team
Ben Boger
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Share this question
or