本来挺简单的事,自己想复杂了,就参照http://support.microsoft.com/default.aspx?scid=kb;en-us;306154这个弄了个repeater里嵌套repeater的东西来,写博以记之。
第一步,获得数据,得到两个DataTable,放在一个DataSet中
通过共同的id,把两个DataTable的数据关联起来,并把第一个DataTable的值绑定到父repeater.
客户端方面:
子repeater需要设置DataSource,DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("myRelation") %>'