我想将树视图绑定在转发器内部,如下图所示:
请告诉我怎样才能做到这一点。
答案 0 :(得分:0)
试试这个
protected void myRepeater_OnItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
TreeView MyTree = (TreeView)e.Item.FindControl("MyTreeID");
MyTree.DataSource = MyDataSoure;
MyTree.DataBind();
}
}