Combox数据绑定后变化问题
小弟现在在做一个省市区联动遇到了一个问题,就是第一次选择省的时候可以出现市,选择市的时候,可以出现区,但是我又重新选择省后出现问题了绑定得到省的代码:
程序代码:
AreasData Sarea = new AreasData(); ExecObj ordExecObj = CN56NET.LPP.Members.GetBusiness.InitClass.GetLocalMembersAreasSystem().GetAreasByParentCode(ref Sarea, PubWinClass.ConnObj, "Directory.Areas"); if (ordExecObj.ExecFlag) { Cob_StartProvince.DataSource = Sarea.Tables[0]; Cob_StartProvince.DisplayMember = "AreaName"; Cob_StartProvince.ValueMember = "AreaCode"; }变动省选择项后联动事件
程序代码:
Cob_StartCity.Items.Clear(); Cob_StartCounty.Items.Clear(); AreasData Sarea = new AreasData(); ExecObj ordExecObj = CN56NET.LPP.Members.GetBusiness.InitClass.GetLocalMembersAreasSystem().GetAreasByParentCode(ref Sarea, PubWinClass.ConnObj, Cob_StartProvince.SelectedValue.ToString()); if (ordExecObj.ExecFlag) { Cob_StartCity.DataSource = Sarea.Tables[0]; Cob_StartCity.DisplayMember = "AreaName"; Cob_StartCity.ValueMember = "AreaCode"; }变动市选择项后联动事件
程序代码:
Cob_StartCounty.Items.Clear(); AreasData Sarea = new AreasData(); ExecObj ordExecObj = CN56NET.LPP.Members.GetBusiness.InitClass.GetLocalMembersAreasSystem().GetAreasByParentCode(ref Sarea, PubWinClass.ConnObj, Cob_StartCity.SelectedValue.ToString()); if (ordExecObj.ExecFlag) { Cob_StartCounty.DataSource = Sarea.Tables[0]; Cob_StartCounty.DisplayMember = "AreaName"; Cob_StartCounty.ValueMember = "AreaCode"; }
第一次成功但是再此选择出现