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

AutoPostBack Kendo ComboBox MVC 5

1 Answer 189 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Santiago
Top achievements
Rank 1
Santiago asked on 27 Apr 2015, 12:12 PM

Hi Telerik Team,

We are facing an issue with the Kendo ComboBox Control on MVC5. 

Is there any way to avoid/deactivate the AutoPostBack of the ComboBox when the user press the enter key? We've tried to bind by jQuery other functions on keypress and keydown events without luck.

 

Here is the code:

@(Html.Kendo().ComboBox()
         .Name("cmbUsuarios")
         .DataTextField("NombreUsuario")
         .DataValueField("Id")
         .Placeholder("Seleccione Usuarios...")
         .Filter(FilterType.StartsWith)
         .AutoBind(false)
         .HtmlAttributes(new { @class = "form-control", @style = "width: 100%" })
         .MinLength(2)
         .DataSource(source =>
         {
             source.Read(read =>
             {
                 read.Action("GetUsers", "Perfil")
                     .Data("filterUsers").Type(HttpVerbs.Get);
             })
             .ServerFiltering(true);
         }))

<script>
function filterUsers() {
        return {
            userFilter: $("#cmbUsuarios").data("kendoComboBox").text()
        };
    }
</script>

 

Version of Kendo.Mvc: 2015.1.318.545

Thanks!

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 29 Apr 2015, 07:10 AM
Hello Santiago,

If my understanding is correct, you would like to prevent form post when user presses ENTER key. If this is the case, then I would suggest you check this how-to demo.

Regards,
Georgi Krustev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ComboBox
Asked by
Santiago
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or