protected void rptMain_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Repeater rep = e.Item.FindControl("rptSub") as Repeater;//找到里层的repeater对象 Literal lblGroupID = (Literal)e.Item.FindControl("lblGroupID"); rep.DataSource = m_Registration.GetItemResults(RegisterNo, Convert.ToInt32(lblGroupID.Text)); rep.DataBind(); } }
public List <ItemResult> GetItemResults(String RegisterNo, int GroupID) { List <ItemResultViewEntity> ItemResultList = m_Registration.GetItemResults(RegisterNo, GroupID); var q = from p in ItemResultList select new ItemResult { GroupID = p.ID.GroupID.Value, ItemName = p.ItemName, CheckedResult = p.CheckedResult, MeasureUnit = p.MeasureUnit, LowerLimit = p.LowerLimit, UpperLimit = p.UpperLimit, NormalTips = p.QualitativeResult, CheckDoctor = p.CheckDoctor, CheckDate = p.CheckDate }; return(q.ToList()); }