本文主要是介绍Repeater两层嵌套和三层嵌套repeater1_ItemDataBound绑定,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Repeater两层嵌套和三层嵌套repeater1_ItemDataBound绑定
两层嵌套
protected void rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rpt = (Repeater)e.Item.FindControl(&"rpt_Level04&");
int typeFatherID = ((CommonType)e.Item.DataItem).TypeID;
rpt.DataSource = da.GetAllNodeInfo(tt, typeFatherID);
rpt.DataBind();
}
}
三层嵌套
protected void rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rpt = (Repeater)e.Item.FindControl(&"rpt_Level04&");
int typeFatherID = ((CommonType)e.Item.DataItem).TypeID;
rpt.DataSource = da.GetAllNodeInfo(tt, typeFatherID);
rpt.DataBind();
}
}
这篇关于Repeater两层嵌套和三层嵌套repeater1_ItemDataBound绑定的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!