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

search as you type

10 Answers 167 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Srujana
Top achievements
Rank 1
Srujana asked on 18 Mar 2011, 10:35 PM
Hello,

I need a text box with search as I type(like google one), I don't see any in silverlight suite,  I was thinking about using Combo with same functionality, but my only concern is it is tied to a data column that has like 100,000 rows, I was just wondring if it would affect the performance in anyway, if yes, what is the possible solution to have the same functionality.

Please let me know,

Thanks,
SC.

10 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 19 Mar 2011, 12:02 PM
Hi Srujana,

Please, check the attached sample application - it demonstrates how to create a google-like search box with RadComboBox. Let me know if you have additional questions.

Kind regards,
Valeri Hristov
the Telerik team
0
Srujana
Top achievements
Rank 1
answered on 19 Mar 2011, 07:45 PM
Hi Valeri,

Thanks for the prompt response and a sample code, My question is not fully answered though, Would it affect the perfomance to bind it(combo) the data field that has like 100,000 rows?

Thanks in advance,
Srujana.
0
Valeri Hristov
Telerik team
answered on 21 Mar 2011, 10:50 AM
Hello Srujana,

The attached application is not performance dependent on the underlying data table size as it requests only a few items from the data service.

If you directly bind RadComboBox to a 100000 items source (e.g. you do not use the attached app) you will have to change the ItemsPanel to VirtualizingStackPanel, but in this case the filtering in the control will cease to work (this is a known limitation).

Regards,
Valeri Hristov
the Telerik team
0
Srujana
Top achievements
Rank 1
answered on 29 Mar 2011, 11:02 PM
Thanks Valeri.

I tried to open the code and take a look, but it is broken, It gives me compilation errors. I am trying to look at the code to see what it is doing, but I am not sure if it is getting the results from database or google? I need to search the database table to see if the entered text is matching any existing string in the table, if so, display them as options for the users so they don't type anymore, I have see it in Ajax, but not in the silverlight, I can use either textbox or combo depending on the functionality offered, if you could give me some input one how to proceed on this, I would certainly appriciate it.

Thanks in advance,
Srujana.
0
George
Telerik team
answered on 04 Apr 2011, 01:39 PM
Hi Srujana, 


Please, unload all WPF projects and reload the Silverlight ones. Please, make sure you have added the following assemblies:
  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.Input
to the following projects: AutocompleteBox.SL & AutocompleteBehavior_SL. Clean the solution and rebuild. Everything should compile. 

The two RadComboBoxes are bound for two different data sources:
  • The top RadComboBox uses for the GoogleAutocompleteProvider
  • The bottom RadComboBox uses the StrangeWordsCollection.

The Products database is not used in the project, but you could easily implement the logic. All you need is to download the AdventureWorks sample database and to modify the connection string. After that, you could add the following method to the ProductsService:

[Query(IsComposable = true)]
        public IQueryable<Product> GetProductsByText(string text)
        {
            return this.ObjectContext.Products.Where(p => p.Name.StartsWith(text));
        }

We will use this method to load the products by name from the database. 
Now, you could implement the IAutocompleteProvider and set it for AutocompleteProvider to the RadComboBox control in xaml.

Attached you can find the modified project. I hope this suits your needs.


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
Build-dude
Top achievements
Rank 1
answered on 05 Mar 2012, 07:34 PM
Is there a way to load a persisted value into the selected item?  When I try this I have empty text in the combo box.
0
George
Telerik team
answered on 08 Mar 2012, 10:31 AM
Hi,

We are aware of this problem, but currently we don't have any workarounds. We have plans to implement RadAutocompleteBox for our further releases, but we cannot say in what time-frame it will be done. 


Kind regards,
George
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Yonggu Kang
Top achievements
Rank 1
Iron
answered on 21 Sep 2012, 05:05 PM

Hi, George

I aslo use google like control in my edit view nearly same with above sample.
When the edit view is opened with view model with some edit data,
combox box has no source and no selectedItem untill user types and changes text,
but it's Text can be shown because text property synched with some added property,say 'partNo', in user control
and 'PartNo' property is binded with my view model.

It worked well in nearly 10 usecontrols untill I encountered in 1 control which always show
empty Text as Aaron pointed out in above thread.
When debugging, 'PartNo' property set and Text property is synched at first but immediately Text property
changed into empty. When runs step by step in debug, Text property shows fine but in normal running,no luck.

Is this same reason ?
If so, what makes me stuck is how my other usecontrols show Text property fine ?
Would you pls give me advice about inner working a bit more ?

Now I'm using Q1 2012 and looked in Q2 2012 but your mentioned control looks not added yet.
As you metioned,will it be added in Q3 Oct ?

RGDS
Kang

0
Ivo
Telerik team
answered on 26 Sep 2012, 03:07 PM
Hi Kang,

The RadAutoCompleteBox will be released with the Q3 2012 release of RadControls for Silverlight.

All the best,
Ivo
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Yonggu Kang
Top achievements
Rank 1
Iron
answered on 03 Oct 2012, 07:08 AM
Hi Ivo,

Thank you for your kind info.
I will wait Q3 arrives soon rather than reinventing the wheel.

RGDS
Kang
Tags
ComboBox
Asked by
Srujana
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Srujana
Top achievements
Rank 1
George
Telerik team
Build-dude
Top achievements
Rank 1
Yonggu Kang
Top achievements
Rank 1
Iron
Ivo
Telerik team
Share this question
or