Repeater使用二

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                    string id = ((DataRowView)e.Item.DataItem)["ID"].ToString();
                           }

 ((DataRowView)e.Item.DataItem)只在itemcreate和itemdatabind事件中不为null

找到HeaderTemplate里的控件:

this.rptBook.Controls[0].FindControl("ckbCheckAll")

原文地址:https://www.cnblogs.com/gossip/p/2206601.html