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

AutoCompleteBox Column

4 Answers 116 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Terry Foster
Top achievements
Rank 1
Terry Foster asked on 25 May 2011, 02:15 AM
Hi,

I've created a custom column (in code) that derives from the GridViewDataColumn, but when editing, instead of a TextBox, I return an AutoCompleteBox.  Pretty straightforward and works as expected, except that pressing 'Enter' does not end cell editing (it doesn't do anything), and pressing 'Esc' does not revert to the old value (it commits the new value) - all of which happens automatically for just the GridViewDataColumn with the TextBox editing control.  Do you have any idea what I need to do to get this same functionality?

Thanks,
Terry

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 May 2011, 09:35 AM
Hello Terry Foster,
for this scenario to work , the key  event ( in your case pressing enter ) , should be allowed to bubble up to the cell .

May be in your case the autocomplete box does not allow this to happen . 

As a side note  - a good alternative to autocomplete box  would be a RadComboBox , with allowed text editing .  This may give you a kind of "search-as-you-type " functionality which you may be looking for.

Regards,
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
Terry Foster
Top achievements
Rank 1
answered on 25 May 2011, 02:55 PM
Hi Pavel,

I'm trying to use the GridViewComboBoxColumn with IsComboBoxEditable equal to true, but it appears that you can only set the value to one of the values in the items source.  I only want the items in the items source to be suggestions, but allow the user to input any text they want (and then add it to the items source if it's not there).  Is there any way to do this with the RadComboBox?

Thanks,
Terry
0
Pavel Pavlov
Telerik team
answered on 30 May 2011, 10:09 AM
Hello Terry ,

I am attaching  a small sample for you .

All the best,
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
Terry Foster
Top achievements
Rank 1
answered on 02 Jun 2011, 05:19 PM
Hi Pavel,

After incorporating the solution in your sample, I realized that all I really needed to do was bind the 'Text' property (instead of the 'SelectedItem' property) and I was able to get it all working just like I need.  Now 'Enter' and 'Esc' behave just as I would expect.

Thanks!
Terry
Tags
GridView
Asked by
Terry Foster
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Terry Foster
Top achievements
Rank 1
Share this question
or