private void LoadItems() { string name = null; string countryCode = null; var orderBy = CountrySortingType.IdAsc; if (HasState(ISO3166_CODE_FILTER)) { countryCode = GetStringState(ISO3166_CODE_FILTER); } if (HasState(COUNTRY_NAME_FILTER)) { name = GetStringState(COUNTRY_NAME_FILTER); } if (HasState("OrderBy")) { orderBy = (CountrySortingType)GetIntState("OrderBy"); } var result = ShippingService.GetPagedCountry( pageIndex: gvItems.CustomPageIndex, pageSize: gvItems.PageSize, name: name, countryCode: countryCode, orderBy: orderBy); if (result != null) { gvItems.DataSource = result.Items; gvItems.RecordCount = result.TotalCount; gvItems.CustomPageCount = result.TotalPages; } gvItems.DataBind(); if (gvItems.Rows.Count <= 0) { enbNotice.Message = "No records found."; } }