zoukankan      html  css  js  c++  java
  • Repeater嵌套

    我们自己观察 这是由两个重复项组成的 重复项包含重复项 而重复项的数据源是由订单号决定 即父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

  • 相关阅读:
    郑码
    AutoCAD 安装
    China Mobile 移动
    CCB 建行
    Word基础
    Java 继承
    Java 封装(内部类)
    Java 类与对象
    Java 方法
    Java 数组
  • 原文地址:https://www.cnblogs.com/ZaraNet/p/9433446.html
Copyright © 2011-2022 走看看