This question is locked. New answers and comments are not allowed.
Hello
I am setting up a grid within a smaller component.
The whole component is fetched through ajax and the grid is displayed correctly and the ajax updates for the server bindings for paging, sorting etc is working fine. However I have a textbox used to do a quicksearch in the grid and can't get the grid to rebind the data with the filter.
When the rebind function is called the whole page is posted back to itself instead of triggering a ajaxcall (the same thing happens for the ajaxMethod call). Any idea how we can force the grid to re-populate itself with ajax?
This is grid setup:
Ajax controller header:
Javascript code for the search:
I am setting up a grid within a smaller component.
The whole component is fetched through ajax and the grid is displayed correctly and the ajax updates for the server bindings for paging, sorting etc is working fine. However I have a textbox used to do a quicksearch in the grid and can't get the grid to rebind the data with the filter.
When the rebind function is called the whole page is posted back to itself instead of triggering a ajaxcall (the same thing happens for the ajaxMethod call). Any idea how we can force the grid to re-populate itself with ajax?
This is grid setup:
GridBuilder<T> factory = html.Telerik().Grid<T>();factory.Name("QuickSearch");factory.DataBinding(builder => builder.Ajax() .Enabled(true) .Select("AjaxGetObject", "Ajax") .OperationMode(GridOperationMode.Server));factory.Columns(grid.GetColumns());factory.Sortable(builder => builder.Enabled(true));factory.Pageable(builder => builder.PageSize(grid.PageSize).Total(grid.TotalRecords).Enabled(true));factory.EnableCustomBinding(true); Ajax controller header:
[GridAction(EnableCustomBinding = true)]public ActionResult AjaxGetObject(GridCommand command, string searchExpression)Javascript code for the search:
function Rebind(search) { var grid = $("#QuickSearch").data("tGrid"); grid.rebind({ searchExpression: search }); }