public ActionResult ManageRoles_Read([DataSourceRequest] DataSourceRequest request, long PersonId) { var startRowIndex = (request.Page - 1) * request.PageSize; int Total = 0; var SearchText = Request.Form["SearchText"]; if (request.PageSize == 0) { request.PageSize = 10; } var Classs = _PersonBAL.TMS_PersonRolesMapping_GetbyPersonIDBAL(PersonId, CurrentUser.CompanyID, startRowIndex, request.PageSize, ref Total, GridHelper.GetSortExpression(request, "ID"), SearchText); var result = new DataSourceResult() { Data = Classs, // Process data (paging and sorting applied) Total = Total // Total number of records }; return(Json(result)); }