private void Search() { ManagePagination.SearchSource = ManagePagination.DataSource .Where( h => h.Address1.ToLower().Contains(Searchtxt.ToLower()) || h.Name.ToLower().Contains(Searchtxt)) .ToArray(); ManagePagination.PageCount = (int)Math.Ceiling((int)ManagePagination.SearchSource.Length / (decimal)ManagePagination.ItemPerPage); ManagePagination.Paginate(0); }
protected override async Task OnInitializedAsync() { try { IsLoading = true; ManagePagination = new ManagePagination <LandlordDto>(); Landlords = await LandlordServices.GetLandlords(); ManagePagination.DataSource = Landlords; ManagePagination.SearchSource = Landlords; ManagePagination.PageCount = (int)Math.Ceiling((int)ManagePagination.SearchSource.Length / (decimal)ManagePagination.ItemPerPage); ManagePagination.Paginate(0); IsLoading = false; } catch (Exception ex) { Console.WriteLine(ex); IsLoading = false; throw; } }