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

Is it possible to get ID of data text field in controller?

2 Answers 173 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Bspreethi
Top achievements
Rank 1
Bspreethi asked on 24 Jan 2013, 06:12 AM
Hi,

I'm using kendo autocomplete in MVC Razor as
 @(Html.Kendo().AutoComplete()
                                    .Name("txtWorkAssignedTo")
                                              .Filter("startswith")
                                              .Placeholder("Select Employee...")
                                              .DataTextField("EmployeeFirstName")
                                              .BindTo(Model.Employees)
                                              )
where Model.Employees datasource class contains
EmployeeFirstName
EmployeeKey
EmployeeLastName and so.

I want to get EmployeeKey in formcollection if they chosen corresponding EmployeeName in autocomplete.
I used telerik in my last project and know that's possible. Here i cnat able to understand few things.
Expecting Team's Help...

Thanks,
PreethiBaskaran.

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Jan 2013, 06:59 AM
Hello Bspreethi,

When submitting the AutoComplete only the text is submitted, in contrast to the DropDownList and the ComboBox widgets which submit the underlying ID (if there is such) the autocomplete behaves as a regular text box.
If you want to present text to the user but send the ID consider using the ComboBox widget.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bspreethi
Top achievements
Rank 1
answered on 28 Jan 2013, 05:21 AM
Thanks. I used combobox instead if autocomplete.
Tags
AutoComplete
Asked by
Bspreethi
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Bspreethi
Top achievements
Rank 1
Share this question
or