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

RadComboBox as a search textbox deletes text

5 Answers 142 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Abdulrahman Omran
Top achievements
Rank 1
Abdulrahman Omran asked on 08 Apr 2011, 02:38 AM
Hi,

I have implemented a search textbox functionality using a radcombobox. The way I do it is by lisening to the KeyUp event and get the text property and perform a search using the text displayed on the combobox. The itemsSource property is bound to a collection called Managers.

My simple search function will get the first 10 records from the database that match the search text and store them to the Managers collection.

Now Im running into a small issue which is "disappearing" text from the combobox.
Here is how the issue occurs:
1) say the current selected manager is called Albert and the itemsSource collection includes 3 record {Albert, Alan, Andre}.
2) The user then performs a search by entering the character 'b' this will get 10 manager record that start with 'b'.
3) the itemsSource doesn't contain Albert anymore. Therefore the SelectedItem is set to null
4) The combobox text will be cleared.
5) how this is an issue? if the user now types the character 'e' my search function will find record starting with 'e' instead of the sequence 'be'


I hope there is an easy work-around. I will appreciate any helpful feedback.


Regards,
Abdul

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 13 Apr 2011, 11:22 AM
Hello,

 
Please, refer to the following forum thread, where you can find an additional information about this problem - http://www.telerik.com/community/forums/silverlight/combobox/changing-itemsource-with-selectedvalue-binding.aspx

The RadComboBox is not designed to work in this way ( I suppose you use WCF/RIA Services and get the result from a database). We have an example that shows how to accomplish such scenario. Attached you can find it.

I hope this helps.

Kind regards,
George
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
Abdulrahman Omran
Top achievements
Rank 1
answered on 13 May 2011, 08:33 PM
Hi George,

I have tried the sample solution you have attached but it also has the same issue.
I read the code and I think it tries to solve this issue by adding the current selected item to the items source b4 it updates.
However this doesn't completely solve the issue as the textChanged (the new value will be the selected item's text) event will still be raised after the items source is updated triggering another search. You can try the solution to observe the same behavior.

A searchable comboBox that contacts the server to get it's results is a really desirable behavior and I hope in future releases Telerik will provide an out of the box controller to achieve such functionality. For the time being we have to do with a few workarounds.

I have seen that the desired behavior has been achieved on the weather demo. I'm going to analyze the code on the demo to achieve a similar functionality.

For the time being, I would still appreciate any feedback. : )

I'm sorry for my late reply.


Kindest Regards,
Abdul
0
George
Telerik team
answered on 20 May 2011, 10:10 AM
Hello,

 
We are targeting this problem in our further releases, but we cannot say a current release date for now. Please do not hesitate to contact us if you require any further assistance.


Kind regards,
George
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
Simon
Top achievements
Rank 1
answered on 21 Mar 2012, 10:29 AM
Has this problem been solved?
We're almost a year on.
0
Konstantina
Telerik team
answered on 26 Mar 2012, 09:54 AM
Hi Simon,

Since the RadComboBox is not designed to work like this, we decided to create an AutoCompleteBox which main functionality will be exactly this. However, for now I cannot give you a release date when this control will be available - if we manage to include it in the next Q, it will be announced publicly.

Greetings,
Konstantina
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ComboBox
Asked by
Abdulrahman Omran
Top achievements
Rank 1
Answers by
George
Telerik team
Abdulrahman Omran
Top achievements
Rank 1
Simon
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or