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

AutoComplete send selected dataitem to Controller

1 Answer 108 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Ludek Soukup
Top achievements
Rank 1
Ludek Soukup asked on 10 Mar 2017, 10:48 AM

Hi,

I have problem with getting seleted dataitem to controller from AutoComplete. This work only in popup editor on grid, but with Ajax.BeginForm not :(, I don't know how popup editor submit data to controler but it send complete dataitem. If I use AutoComplete on Window in Ajax.BeginForm it send only string value.

Please can you help me with this. I don't want use ComboBox.

 

Best regards,

Ludek

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 14 Mar 2017, 09:00 AM
Hello Ludek,

By design the AutoComplete does not have a dataValueField configuration option (only dataTextField) and submits only its selected text value. If in addition to the text value you want to access a different property value (Id for example) we can suggest getting the value from the dataItem in the AutoComplete's select event and saving in a hidden field that you can then access in the controller.

Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
AutoComplete
Asked by
Ludek Soukup
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or