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

Auto-complete combobox in gridview?

6 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 02 Jul 2010, 07:47 AM
Hello.  I have an application which I developed in .NET 3.5 and recently converted it to 4.0.  I am using the standard .NET gridview with a couple of autocomplete textboxes on each row.  I am using the autocompleteextender in the Ajax Toolkit.  I would like to replace this gridview with a silverlight radgridview.  So far I have been able to add a silverlight project to my solution and populate the grid with my data.  I was also able to implement an auto-complete combobox outside the grid by following these instructions:

http://blogs.telerik.com/valerihristov/posts/08-12-04/auto-complete_combobox_with_wcf_service_and_radcontrols_for_silverlight.aspx

Now my question is, how can I get that same functionality in the grid? 

6 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 02 Jul 2010, 09:09 AM
Hello Kjell,

You will need to add a GridVIewComboBox column to your RadGridView.
To enable the user to type in and the combo to autocomplete - you will need to set the IsComboBoxEditable property of the GridViewComboBoxColumn to true.

Greetings,
Pavel Pavlov
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
Kjell
Top achievements
Rank 1
answered on 02 Jul 2010, 05:26 PM
Do you have any examples of the following:

* Combo box is in a gridview
* Combo box has auto complete feature and is populated from WCF service
* supports 1000s of items

The field in question is dynamically populated and can have 1000s of items in it, we use the auto complete not only because it looks cool to the user but also because it is a good way of not having to send the entire dataset to the browser.  I am looking for an example of similar functionality in the silverlight radgridview.
0
Pavel Pavlov
Telerik team
answered on 08 Jul 2010, 01:34 PM
Hello Kjell,

Unfortunately I do not have such example , but I may assist you in achieving the goal :

1. ComboBox is in gridview : 
    There are two ways to achieve that : 
       a.GridViewComboBoxColumn
       b.Placing the combobox in the cell , via the Celltemplate property of a regular column.

2.ComboBox has the AutoComplete feature - this one is easy - just set the RadComboBox.IsEditable property to true and you get the autocomplete feature.
...
is populated by WCF service  -  you can set any IEnumerable as ItemsSource to the RadComboBox
...
-supports 1000s of items - RadComboBox  the items panel of RadComboBox may be set to a
VirtualizingStackPanel . This way the performance with 1000 items will not suffer.

Now since in your last post you mention that data should be requested on portions from the server and you already have a working solution with RadComboBox,
I would recommend to chose the approach form 1.a - placing a RadComboBox inside the cell.
Each column has a CellTemplate property. Using this property you may set a template with a combo inside.

Let me know if you find any specific problem while implementing this.

Sincerely yours,
Pavel Pavlov
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
Kjell
Top achievements
Rank 1
answered on 08 Jul 2010, 10:44 PM
Thanks it is working great now.
0
Srujana
Top achievements
Rank 1
answered on 01 Apr 2011, 10:47 PM

Hello,

I know it a old post, but I have simmilar requirement, and the items in my case is 100,000(yes, I said it right), would that work with the same technique below, I am trying to implement it using silverlight toolkit autocomplete box, (with dynamic data binding on populating event using Ria services, it works great outside the grid, but  when I added it to Telerik grid edit template, I am not finding a way to update the itemsource of the autocomplete box every time there is a change in entered text.

 

Could you please tell me how to find a control within the Grid edit cell template and assign the itemsource everytime user types new text in to the autocomplete box control?

Thanks,
SC.

0
Kjell
Top achievements
Rank 1
answered on 01 Apr 2011, 11:18 PM
I am doing this with the radcombobox in a template column, I have the keyupevent handler call a web service to get the list.  I'm not sure how big my datasources have gotten but at least 20,000, 100k shouldn't be a problem.  

Every time there is a key press, I pass in the text from the combo box and then do "select top 20 * from blahblah where blah like 'text%'.  I also require that the user enter at least 2 characters before I start making the web service calls, so that already helps pare down the results.   I also cache the entire list in memory so I'm not continually making SQL calls.  Let me know if you need more details.
Tags
GridView
Asked by
Kjell
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Kjell
Top achievements
Rank 1
Srujana
Top achievements
Rank 1
Share this question
or