Example #1
0
        /// <summary>
        /// Bind Data to Drop Downs
        /// </summary>
        private void BindCounties()
        {
            ListItem firstListItem = new ListItem(ddlCounty.Items[0].Text, ddlCounty.Items[0].Value);

            ddlCounty.Items.Clear();

            if (ddlDistrict.SelectedValue != "0")
            {
                MasterBLL objMasterBLL = new MasterBLL();
                ddlCounty.DataTextField  = "CountyName";
                ddlCounty.DataValueField = "CountyID";
                ddlCounty.DataSource     = objMasterBLL.LoadCountyData(ddlDistrict.SelectedValue);
                ddlCounty.DataBind();
            }
            ddlCounty.Items.Insert(0, firstListItem);
            ddlCounty.SelectedIndex = 0;
        }