Reputation: 11
I have a dropdownlist with a submit button in my view. When I select a value in dropdownlist and hit submit button, HTTPPOST action in the controller is called and it binds data to the telerik mvc grid. Now, if I click the paging link in the grid, HTTPGET action in the controller is called and the grid is gone. How to persist the selected value of the dropdownlist and rebind data to telerik grid? Appreciate your help
Upvotes: 1
Views: 1219
Reputation: 30671
You have two options
Pass the required value to the Select method of the databinding settings:
<%= Html.Telerik().Grid()
.DataBinding(dataBinding => dataBinding
.Server()
.Select("Action", "Controller",
new { value = ViewData["dropDownValue"] })
)
%>
Then you can get it from the action method:
public ActionResult Action(string value)
{
//
}
Upvotes: 1