原帖地址:http://dotnet.aspx.cc/ShowDetail.aspx?id=54F4C732-AAE2-4135-FB1B-7B4B613BAA33
修改了一下把在html里面绑定修改为后台cs代码中绑定
加上一下代码即可
private void parentRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
DataGrid dg = (DataGrid)e.Item.FindControl("dg1");
DataRowView drv = (DataRowView)e.Item.DataItem;
DataView dv = drv.CreateChildView("myrelation");
dg.DataSource = dv;
dg.DataBind();
}
{
DataGrid dg = (DataGrid)e.Item.FindControl("dg1");
DataRowView drv = (DataRowView)e.Item.DataItem;
DataView dv = drv.CreateChildView("myrelation");
dg.DataSource = dv;
dg.DataBind();
}