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 GeographicLocationLookupCity grid /// </summary> private void BindGridCity() { try { objGeographicLocation = new GeographicLocationDal(); DataSet dsGeographicCity = objGeographicLocation.GetCityName(""); radgrdCity.DataSource = dsGeographicCity; radgrdCity.DataBind(); ViewState[vsGeographicCity] = dsGeographicCity; if (radgrdCity != null) { for (int i = 0; i < radgrdCity.Items.Count; i++) radgrdCity.Items[i].Edit = false; } } catch (Exception ex) { } }