<table class="table table-bordered table-fixed">
<thead>
<tr>
<th width="">
<input type="checkbox" id="chkAll" onclick="selectAll()" /></th>
<th width="" class="text-center"><%=Resources.Asset.DictViewRowIndex%></th>
<th width=""><%=Resources.Asset.UserDepartments%></th>
<th width=""><%=Resources.Asset.AssetCategory%></th>
<th width=""><%=Resources.Asset.AssetSubClass%></th>
<th width=""><%=Resources.Asset.AssetsCompany%></th>
<th width=""><%=Resources.Asset.AssetName%></th>
<th width=""><%=Resources.Asset.AssetsState%></th>
<th width="">数量</th>
<th width="">原值</th>
</tr>
</thead>
<tbody>
<asp:Repeater ID="rptDept" runat="server" OnItemDataBound="rptDept_ItemDataBound">
<ItemTemplate>
<tr>
<td>
<input type="checkbox" class="assetId" id='<%#((iWS.Assets.DB.Asset)Container.DataItem).Id%>' onclick="SelectSingle();" /></td>
<td class="text-center"><%# Container.ItemIndex + + (this.pagerControl.CurrentPageIndex -) * this.pagerControl.PageSize%></td>
<td><%#((iWS.Assets.DB.Asset)Container.DataItem).Owner!=null?((iWS.Assets.DB.Asset)Container.DataItem).Owner.Depts:"" %></td>
<td colspan="" style="padding: 0;">
<table style="border: none; width: 100%;">
<asp:Repeater ID="rptDeptSub" runat="server">
<ItemTemplate>
<tr>
<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)
{
try
{
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);
}
}

C# Repeater 嵌套的更多相关文章

  1. Repeater 嵌套,子级Repeater获取 父级Repeater 中的值

    第一种方法,子级Repeater中绑定父级的某个字段: <%# DataBinder.Eval((Container.NamingContainer.NamingContainer as Rep ...

  2. Repeater嵌套(灵活的)

    页面代码 <form id="form1" runat="server"> <asp:Repeater ID="rptCategor ...

  3. Repeater嵌套Repeater并取得嵌套Repeater里面的控件

    前台代码:    <asp:Repeater ID="RepeaterScene" runat="server" OnItemDataBound=&quo ...

  4. ASP.NET Repeater嵌套Repeater实现菜单加载

    在KS系统中要实现从数据库中读取界面权限文件实现菜单.界面的动态加载. 效果图: ASP.NET界面代码 <div id="menu-container"> <a ...

  5. 关于Repeater嵌套绑定的问题

    前台代码: <div id="firstpane" class="menu_list">                <asp:Repeat ...

  6. Repeater嵌套绑定Repeater

    前台Html代码 <asp:Repeater runat="server" ID="rpList" OnItemDataBound="rpLis ...

  7. 转:Repeater嵌套绑定Repeater以及内层调用外层数据

    <table border=" style="margin-bottom: 5px" width="100%"> <asp:Repe ...

  8. DataList与Repeater嵌套绑定

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs&quo ...

  9. asp.net:repeater嵌套(常用于新闻等在首页归类显示)

    using System;using System.Configuration;using System.Collections.Generic;using System.Linq;using Sys ...

  10. Repeater嵌套gridview

    前台:<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSour ...

随机推荐

  1. 幻想乡三连B:连在一起的幻想乡

    $G[k][x]$表示所有$x$个点的无向图中每一个图的边数的$k$次方之和. $F[k][x]$就是在$G[k][x]$的基础上加了一个整体连通的性质. 有一个经典的套路就是对于$F$在对应的$G$ ...

  2. Nhibernate 三种配置方式

    1 App.config 的配置: <?xml version="1.0" encoding="utf-8" ?><configuration ...

  3. ACM学习历程——UVA 127 "Accordian" Patience(栈;模拟)

    Description  ``Accordian'' Patience  You are to simulate the playing of games of ``Accordian'' patie ...

  4. python构造一个http请求

    我们经常会用python来进行抓包,模拟登陆等等, 势必要构造http请求包. http的request通常有4个方法get,post,put,delete,分别对应于查询,更新,添加,删除.我们经常 ...

  5. Log4Net日志记录介绍

    原文地址 : http://www.cnblogs.com/wolf-sun/p/3347373.html#3009010 简介 log4net库是Apache log4j框架在Microsoft . ...

  6. Ubuntu下安装软件

    在ubuntu当中,安装应用程序有三种方法,分别是:apt-get,dpkg安装deb和make install安装源码包三种. apt-get方法 使用apt-get install来安装应用程序算 ...

  7. hdu 1074 状态压缩

    http://acm.hdu.edu.cn/showproblem.php?pid=1074 我们可以断定状态的终止态一定是n个数全部选完的情况,那么它的前一个状态是什么呢,一定是剔除任一门课程后的n ...

  8. k8s 基础 pod操作

    创建hell world pod #vim hello-world-pod.yaml apiVersion: v1 kind: Pod metadata: name: hello-world spec ...

  9. CSS之边距合并

    外边距合并指的是,当两个垂直外边距相遇时,它们将形成一个外边距.合并后的外边距的高度等于两个发生合并的外边距的高度中的较大者. 情况1:当一个元素出现在另一个元素上面时,第一个元素的下外边距与第二个元 ...

  10. DevKit及rails的安装

    Ruby on Rails的安装,是从被称为RubyGems的包管理系统开始的. Ruby on Rails是由Ruby处理系统的类库的.被称为"gem"的格式来进行配置的.&qu ...