C#Repeater嵌套-飞外

input span >"selectAll()" / /th th width="60" %=Resources.Asset.DictViewRowIndex% /th th width="280" %=Resources.Asset.UserDepartments% /th th width="120" %=Resources.Asset.AssetCategory% /th th width="120" %=Resources.Asset.AssetSubClass% /th th width="300" %=Resources.Asset.AssetsCompany% /th th width="120" %=Resources.Asset.AssetName% /th th width="80" %=Resources.Asset.AssetsState% /th th width="100" 数量 /th th width="100" 原值 /th /tr /thead tbody asp:Repeater ID="rptDept" runat="server" OnItemDataBound="rptDept_ItemDataBound" ItemTemplate input id=' %#((iWS.Assets.DB.Asset)Container.DataItem).Id% ' span >"SelectSingle();" / /td td %# Container.ItemIndex + 1 + (this.pagerControl.CurrentPageIndex -1) * this.pagerControl.PageSize% /td td %#((iWS.Assets.DB.Asset)Container.DataItem).Owner!=null?((iWS.Assets.DB.Asset)Container.DataItem).Owner.Depts:"" % /td td colspan="7" table asp:Repeater ID="rptDeptSub" runat="server" ItemTemplate td %#((iWS.Assets.DB.Asset)Container.DataItem).MainCategory!=null?((iWS.Assets.DB.Asset)Container.DataItem).MainCategory.Name:"" % /td td %#((iWS.Assets.DB.Asset)Container.DataItem).SubCategory!=null?((iWS.Assets.DB.Asset)Container.DataItem).SubCategory.Name:"" % /td td %#((iWS.Assets.DB.Asset)Container.DataItem).Company% /td td %#((iWS.Assets.DB.Asset)Container.DataItem).Name% /td td %#((iWS.Assets.DB.Asset)Container.DataItem).State!=null?((iWS.Assets.DB.Asset)Container.DataItem).State.Name:"" % /td td %#((iWS.Assets.DB.Asset)Container.DataItem).Number% /td td %#((iWS.Assets.DB.Asset)Container.DataItem).Cost% /td /tr /ItemTemplate /asp:Repeater /table /td /tr /ItemTemplate /asp:Repeater /tbody /table
 protected void rptDept_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) Repeater rep = e.Item.FindControl("rptCarryoverMsgSub") as Repeater;//找到repeater对象 DataRowView rowv = (DataRowView)e.Item.DataItem; string fina = rowv["FinacialCode"] + "";//获取关联的流程ID string proj = rowv["ProjName"] + "";//获取关联的流程ID string yewu = rowv["YeWuSuo"] + "";//获取关联的流程ID var query = from r in carryoverDt.AsEnumerable() where r.Field string ("FinacialCode").Equals(fina) r.Field string ("ProjName").Equals(proj) r.Field string ("YeWuSuo").Equals(yewu) select new CarryoverName = r.Field string ("CarryoverName"), Account = r.Field decimal ("Account"), SubDebt = r.Field decimal ("SubDebt"), TotalInCome = r.Field decimal ("TotalInCome"), HistoryInCome = r.Field decimal ("HistoryInCome"), CurrentInCome = r.Field decimal ("CurrentInCome"), LastCarryoverToCurrentInCome = r.Field decimal ("LastCarryoverToCurrentInCome"), TotalCarryover = r.Field decimal ("TotalCarryover"), HistoryCarryover = r.Field decimal ("HistoryCarryover"), CurrentCarryover = r.Field decimal ("CurrentCarryover"), CurrentFinalBalance = r.Field decimal ("CurrentFinalBalance"), CurrentOutCome = r.Field decimal ("CurrentOutCome"), OutComeCanCarryover = r.Field decimal ("OutComeCanCarryover"), Progess = r.Field int ("Progess"), ProgressCanCarryover = r.Field decimal ("ProgressCanCarryover"), ThisCarryover = r.Field decimal ("ThisCarryover") DataTable dt = DataTableHelper.ToDataTable(query.ToList()); rep.DataSource = dt; rep.DataBind(); catch (Exception ex) DiskLog.LogError("ImplementAsyncData-rptAchiveData_ItemDataBound", ex); }