This is most certainly possible. You will need to get more familiar with jQuery though. It looks like you have a handle on the Kendo Grid events, so I won't address that here. Here is the trick (one of)...
In this case a Kendo Grid is being used as a fancy multi-select that each time a new State (ie TX, NY) is selected an event fires in the grid that calls this function. This is more than you asked for so I will explain. It is doing this:
- Add up the list of multi-selected items in the Grid and assign this list to a hidden Form field.
- Use Ajax post to Update the database with this and other information in the Form (the whole form is passed).
2b. Note the 'async: false', this lets the database update before the the next Ajax call.
- Another Ajax post to Query the database again using all the Form fields.
Both Ajax calls access MVC Controller methods that communicate with a database and return partial views to update TWO seperate parts of the page at once. These could be anything, in this case they are both additional Kendo Grids, but a tabbed panel would be just as easy.
function updateParts() {
var grid = $('#States').data('kendoGrid');
var rows = grid.select();
$('#StatesQuery').val('');
rows.each(
function () {
var record = grid.dataItem($(this));
$('#StatesQuery').val($('#StatesQuery').val() + record.StateCode + ",");
}
);
$.ajax({
url: '@Url.Action("UpdateSomething", "Controller")',
type: 'post',
data: $('form#ajaxSearchForm').serialize(),
async: false,
success: function (result) {
$('#SomethingElseDiv').html(result);
}
});
$.ajax({
url: '@Url.Action("QuerySomething", "Controller")',
type: 'post',
data: $('form#ajaxSearchForm').serialize(),
success: function (result) {
$('#SearchResultsDiv').html(result);
}
});
}
Controller Method
[HttpPost]
public ActionResult QuerySomthing(FormCollection formCollection)
{
var query = new Status(); // Complext Data Model for Search
query.States = formCollection["StatesQuery"].Split(',');
... etc
var model = new SearchViewModel(); // ViewModel for Partial
model.StatusSummaries = _submissionsDataProvider.DoQuery(query);
return View("SearchResults", model);
}
I hope you enjoy Kendo and MVC as much as me!