<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. ACM学习历程—Rotate(HDU 2014 Anshan网赛)(几何)

    Problem Description Noting is more interesting than rotation! Your little sister likes to rotate thi ...

  2. CentOS 7关闭firewalld启用iptables

    在CentOS7中,有很多CentOS 6中的常用服务发生了变化. 其中iptables是其中比较大的一个.防火墙iptables被firewalld取代. 本文将介绍,如果采用systemctl关闭 ...

  3. 记一次SQL xml字段关联查询

    需求: 一张表是APP表,结构如下: app_category为该游戏所属的类别ID,xml字段类型 另一张表是类别表,就ID对应名称,这就不上图了. 还有一张表是每个游戏的下载记录,结构如下: Do ...

  4. .net关于应用程序缓存的一些疑惑

    疑惑:获取缓存后强制转换为实体对象传递给前台,如果前台对这个实体对象中属性更改的话缓存中的数据也随之改变,为啥??? 首先是创建缓存的方法: /// <summary> /// 创建缓存项 ...

  5. Zeppelin的入门使用系列之创建新的Notebook(一)

    不多说,直接上干货! 前期博客 hadoop-2.6.0.tar.gz + spark-1.6.1-bin-hadoop2.6.tgz + zeppelin-0.5.6-incubating-bin- ...

  6. Java探索之旅(7)——对象的思考

    1.知识要点 ❶不可变类:一旦创建,其内容不能改变的类称之为不可变类.满足:⑴所有数据域私有,⑵没有修改器,⑶没有访问器方法,其返回一个指向可变数据域的引用.(这样通过引用就能修改私有数据域).比如, ...

  7. 编写html页面时常见的问题(转)

    编写html页面时常见的问题(一)   说到写页面,肯定有很多人在刚接触编写页面这一块时遇到很多细节和兼容性的问题,那么在这里我总结一些经常遇到的小问题.希望能够帮助学习页面搭建的初学者! 虽然说ie ...

  8. C++中对象的常引用

    直接传递对象名 用对象名做函数参数时,在函数调用时将建立一个新的对象,它是形参对象的拷贝. ================下面给出一个直接传递对象名的例子程序1.1================= ...

  9. HDU 5980 Find Small A (水题)

    题意:众所周知,字符 'a' 的ASCII码为97.现在,找出给定数组中出现了多少次 'a' .注意,此处的数字为计算机中的32位整数.这表示, 1个数字由四个字符组成(一个字符由8位二进制数组成). ...

  10. Win7常用但是被忽略的快捷键

    General keyboard shortcuts 1.Ctrl + Right Arrow Move the cursor to the beginning of the next word  向 ...