protected void chkEmp_CheckedChanged(object sender, EventArgs e) { if (chkEmp.Checked) { DS = BindCommanData.BindCommanDropDwon("'E' + convert(nvarchar(max),EmployeeID) as EmployeeID ", " EmployeeCode +' '+EmployeeName as Name ", "EmployeeMaster", "IsActive = 1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { FirstList.DataValueField = "EmployeeID"; FirstList.DataTextField = "Name"; FirstList.DataSource = DS; FirstList.DataBind(); FirstList.Rows = FirstList.Items.Count; //FirstList.Items.Insert(0, new ListItem("--Select Route--", "0")); } else { FirstList.Items.Clear(); } } else { FirstList.Items.Clear(); } dpRouteTemp.ClearSelection(); }
protected void dpRouteTemp_SelectedIndexChanged(object sender, EventArgs e) { //typeList.Clear(); string routeid = dpRouteTemp.SelectedItem.Value.ToString(); DS = BindCommanData.BindCommanDropDwon("'A' + convert(nvarchar(max),AgentID) as AgentID", " AgentCode +' '+AgentName as Name ", "AgentMaster", "RouteID = " + routeid.ToString()); if (!Comman.Comman.IsDataSetEmpty(DS)) { FirstList.DataValueField = "AgentID"; FirstList.DataTextField = "Name"; FirstList.DataSource = DS; FirstList.DataBind(); //FirstList.Rows = FirstList.Items.Count; //FirstList.Items.Insert(0, new ListItem("--Select Route--", "0")); } else { FirstList.Items.Clear(); } }