// fired when user paginates private void CustomerByCountryGrid_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { CustomerByCountryGrid.PageIndex = e.NewPageIndex; CustomerByCountryGrid.DataBind(); } catch (Exception) { throw; } }
// initial data binding to the grid private void BindDataToGridView() { try { CustomerByCountryGrid.DataSource = _customerRepository.GetCustomers(); CustomerByCountryGrid.DataBind(); } catch (Exception) { throw; } }
// bind data to the grid view by country selection private void BindDataToGridViewByCountry() { try { CustomerByCountryGrid.DataSource = _customerRepository.GetCustomerByCountry(CountriesDDL.SelectedValue); CustomerByCountryGrid.DataBind(); } catch (Exception) { throw; } }