C# Repeater 嵌套
<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 嵌套的更多相关文章
- Repeater 嵌套,子级Repeater获取 父级Repeater 中的值
第一种方法,子级Repeater中绑定父级的某个字段: <%# DataBinder.Eval((Container.NamingContainer.NamingContainer as Rep ...
- Repeater嵌套(灵活的)
页面代码 <form id="form1" runat="server"> <asp:Repeater ID="rptCategor ...
- Repeater嵌套Repeater并取得嵌套Repeater里面的控件
前台代码: <asp:Repeater ID="RepeaterScene" runat="server" OnItemDataBound=&quo ...
- ASP.NET Repeater嵌套Repeater实现菜单加载
在KS系统中要实现从数据库中读取界面权限文件实现菜单.界面的动态加载. 效果图: ASP.NET界面代码 <div id="menu-container"> <a ...
- 关于Repeater嵌套绑定的问题
前台代码: <div id="firstpane" class="menu_list"> <asp:Repeat ...
- Repeater嵌套绑定Repeater
前台Html代码 <asp:Repeater runat="server" ID="rpList" OnItemDataBound="rpLis ...
- 转:Repeater嵌套绑定Repeater以及内层调用外层数据
<table border=" style="margin-bottom: 5px" width="100%"> <asp:Repe ...
- DataList与Repeater嵌套绑定
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs&quo ...
- asp.net:repeater嵌套(常用于新闻等在首页归类显示)
using System;using System.Configuration;using System.Collections.Generic;using System.Linq;using Sys ...
- Repeater嵌套gridview
前台:<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSour ...
随机推荐
- ACM学习历程—HDU1695 GCD(容斥原理 || 莫比乌斯)
Description Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = ...
- UnityShader实例15:屏幕特效之Bloom
http://blog.csdn.net/u011047171/article/details/48522073 Bloom特效 概述 Bloom,又称“全屏泛光”,是游戏中 ...
- Unity3D中的Coroutine及其使用(延时、定时调用函数)
http://blog.csdn.net/nizihabi/article/details/47606887 一.Coroutine(协程)的概念和本质 在网上的一些资料当中,一直将Coroutine ...
- js的数据格式之json
//json数据格式语法:1 数据在名称/值对中2 数据由逗号分隔3 花括号保存对象4 方括号保存数组 详情请查看:js的数据格式之json
- Poj 1338 Ugly Numbers(数学推导)
一.题目大意 本题要求写出前1500个仅能被2,3,5整除的数. 二.题解 最初的想法是从1开始检验该数是否只能被2,3,5整除,方法是这样的,对于一个数,如果它能被2整除,就除以2,如果它能被3整除 ...
- HDOJ1151有向图最小路径覆盖
//有向图最小路径覆盖:从某一点出发沿着有向路径,不走回路,能将所有的结点遍历. #include<iostream> #include<cstdio> #include< ...
- C笔试题(一)
a和b两个整数,不用if, while, switch, for,>, <, >=, <=, ?:,求出两者的较大值. 答案: int func(int a, int b) { ...
- C++之string类
1.String对象的初始化 string s1; 默认构造函数,s1为空串 string s4(n, 'c'); 将s4初始化为字符c的n个副本 string s ...
- HDFS追加文件
配置:hdfs-site.xml <property> <name>dfs.support.append</name> <value>true</ ...
- CCS中如何新建Platform以及调用
新建Platform: Debug模式下,选择tools -> RTSC Tools -> Platform -> New,根据自己的需要选择Platform保存的路径以及对应的芯片 ...