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

3 posts, 0 answers
  1. Bspreethi
    Bspreethi avatar
    7 posts
    Member since:
    Mar 2012

    Posted 24 Jan 2013 Link to this post

    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. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 25 Jan 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Bspreethi
    Bspreethi avatar
    7 posts
    Member since:
    Mar 2012

    Posted 27 Jan 2013 Link to this post

    Thanks. I used combobox instead if autocomplete.
Back to Top