protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
    {
        ICustomList CustomManager;

        CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
        DataTable   DTFindRecord = new DataTable();
        ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

        DTFindRecord = CustomManager.GetCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
        DataColumn[] thePKey = new DataColumn[2];
        thePKey[0] = DTFindRecord.Columns[0];
        thePKey[1] = DTFindRecord.Columns[2];
        DTFindRecord.PrimaryKey = thePKey;
        ViewState["GrdData"]    = DTFindRecord;
        Bind_Grid(DTFindRecord);

        //if (DTFindRecord.Rows.Count > 0)
        //{
        //    //FillSelected();
        //    for (int j = 0; j < ddDistrict.Items.Count; j++)
        //    {

        //        ddDistrict.Items[j].Selected = false;


        //    }
        //    for (int i = 0; i < DTFindRecord.Rows.Count; i++)
        //    {
        //        for (int j = 0; j < ddDistrict.Items.Count; j++)
        //        {
        //            if (ddDistrict.Items[j].Value == DTFindRecord.Rows[i][1].ToString())
        //            {
        //                btnSave.Text = "Update";
        //                ddDistrict.Items[j].Selected = true;

        //            }
        //        }
        //    }
        //}
        //else
        //{
        //    for (int j = 0; j < ddDistrict.Items.Count; j++)
        //    {
        //      btnSave.Text = "Save";
        //      ddDistrict.Items[j].Selected = false;


        //    }
        //    //FillNonSelectd();
        //}
    }
        protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e)
        {
            ICustomList CustomManager;

            CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList,BusinessProcess.Administration");
            DataTable   DTFindRecord = new DataTable();
            ICustomList PriorManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");

            DTFindRecord = CustomManager.GetCustomMasterLinkRecord(ViewState["TableName"].ToString(), Convert.ToInt32(ddlRegion.SelectedItem.Value));
            DataColumn[] thePKey = new DataColumn[2];
            thePKey[0] = DTFindRecord.Columns[0];
            thePKey[1] = DTFindRecord.Columns[2];
            DTFindRecord.PrimaryKey = thePKey;
            ViewState["GrdData"]    = DTFindRecord;
            Bind_Grid(DTFindRecord);
        }