Repeater嵌套
2024-09-01 23:49:35
我们自己观察 这是由两个重复项组成的 重复项包含重复项 而重复项的数据源是由订单号决定 即父Repeater的某数据源字段
protected void Repeater1_ItemDataBound1(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rep = e.Item.FindControl("Repeater2") as Repeater;//找到里层的repeater对象
Student student = e.Item.DataItem as Student;
int StudentNo = Convert.ToInt32(student.StudentNo); //获取填充子类的id
rep.DataSource = StudentManager.GetAddressByStudentNo(StudentNo);
rep.DataBind();
}
}
如果使用DateSet数据源的时候 要获取StudentNo这种主键 可以通过DataRowitem
最新文章
- jQuery所支持的css样式
- [QDB] 幽灵分享:QDataSet+TQMSSQLConverter 实战技巧
- C语言实现二叉树-01版
- Cocos2dx老版本适配64位
- Core Java 学习笔记——2.基本数据类型&;类型转换
- 练习--LINUX进程间通信之消息队列MSG
- struts2操作数据库
- Palindrome Partitioning 解答
- 06JS高级创建对象使用原型共享对象方法
- ebs清除并法管理器所清除的表
- 【hanoi】hanoi移动次数和移动步骤
- svn的简介
- RabbitMQ 使用demo
- HTML5 全屏 API
- python+selenium实现登录账户
- mysql5.x安装脚本
- Spring常用注解总结
- Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
- PHP中的回调函数
- spring boot (一): Hello World