protected void acbGeographicLocation_SearchClick(object sender, EventArgs e) { try { switch (mvGeographicLocation.GetActiveView().ID.ToLower()) { case "vwcountry": objGeographicLocation = new GeographicLocationDal(); DataSet dsGeographicCountry = objGeographicLocation.GetCountryName(acbGeographicLocation.SearchTextBox.Text); radgrdCountry.DataSource = dsGeographicCountry; radgrdCountry.DataBind(); ViewState[vsGeographicCountry] = dsGeographicCountry; Reset(); break; case "vwstate": objGeographicLocation = new GeographicLocationDal(); DataSet dsGeographicState = objGeographicLocation.GetStateName(acbGeographicLocation.SearchTextBox.Text); radgrdState.DataSource = dsGeographicState; radgrdState.DataBind(); ViewState[vsGeographicState] = dsGeographicState; Reset(); break; case "vwcity": objGeographicLocation = new GeographicLocationDal(); DataSet dsGeographicCity = objGeographicLocation.GetCityName(acbGeographicLocation.SearchTextBox.Text); radgrdCity.DataSource = dsGeographicCity; radgrdCity.DataBind(); ViewState[vsGeographicCity] = dsGeographicCity; Reset(); break; } } catch (Exception ex) { bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME); if (rethrow) { throw ex; } } }
/// <summary> /// Bind GeographicLocationLookupCountry grid /// </summary> private void BindGridCountry() { try { objGeographicLocation = new GeographicLocationDal(); DataSet dsGeographicCountry = objGeographicLocation.GetCountryName(""); radgrdCountry.DataSource = dsGeographicCountry; radgrdCountry.DataBind(); ViewState[vsGeographicCountry] = dsGeographicCountry; if (radgrdCountry != null) { for (int i = 0; i < radgrdCountry.Items.Count; i++) radgrdCountry.Items[i].Edit = false; } } catch (Exception ex) { } }