I'm trying to learn both Kendo and MVC at the same time, so bear with me. In the code below, I know I could populate my grid via Ajax and frankly I'd be more comfortable with that, but I'm trying to acquaint myself with the basics, so I'd like to avoid it for now.
I would like the contents of my Grid to be restricted by both a DropDownList and a Search box. The issue is that when you turn on Pageable for a Kendo Grid, it wants to GET the next page. But since my DropDownList and my Search box will not be part of the GET params, they won't be available to the Action. So the question:
Is it hopelessly naive to use Grid without Ajax or is there a straightforward way to either include my additional parameters or make the pagination use the form POST?
I would like the contents of my Grid to be restricted by both a DropDownList and a Search box. The issue is that when you turn on Pageable for a Kendo Grid, it wants to GET the next page. But since my DropDownList and my Search box will not be part of the GET params, they won't be available to the Action. So the question:
Is it hopelessly naive to use Grid without Ajax or is there a straightforward way to either include my additional parameters or make the pagination use the form POST?
@using (Html.BeginForm(null, null, FormMethod.Post, new { id="searchForm" })) {
<
script
>
function submit() { $("#searchForm").submit() }
</
script
>
@(Html.Kendo().DropDownListFor(m => m.ListID).DataValueField("ID").DataTextField("Name")
.BindTo(Model.Lists).Events(e => e.Change("submit")))
@Html.Kendo().AutoCompleteFor(m => m.SearchText).Placeholder("Search")
<
input
type
=
"submit"
value
=
"Search"
/>
@Html.Kendo().Grid(Model.Albums).Name("AlbumsGrid").BindTo(Model.Albums).Pageable().Sortable()
}