I assume you have been using remote paging and remote filtering. In case of remote paging, the grid & pager takes totalRecords, curPage, data values from getData callback, so it's up to the remote script to send correct values of theses variables.
getData: function (dataJSON) {
var data = dataJSON.data;
return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
}
You should update the totalRecords, curPage variables on the server side scripts values when filtering takes place as they are ultimately passed on to getData callback.