.Net怎么实现网格嵌套
例如:
+服装类————————————————————parent row
1 西服-----------|
2 裙子 |--------------------------only child grid
3 牛仔裤---------|
+食品类————————————————————parent row
1 罐头-----------|
2 火腿 |--------------------------only child grid
3 方便面---------|
-日常用品类——————————————————parent row
-电器类————————————————————parent row
用datagrid怎么样实现上面的功能。请贴源码,谢谢!!!
selectcustomerstr = "select customerid,customer,customertype,linkman,telphone,fax,mobil,email from customer where userid='" & userid & "'"
selectorderstr = "select saleorderno,customerid,ordername,orderstate,creartday from saledetail"
Dim selectcustomeradap As New SqlDataAdapter(selectcustomerstr, con)
Dim selectorderadap As New SqlDataAdapter(selectorderstr, con)
Dim selectcustomerset As New DataSet
selectcustomeradap.Fill(selectcustomerset, "customer")
selectorderadap.Fill(selectcustomerset, "saledetail")
Dim pa As New DataColumn
Dim ch As New DataColumn
pa = selectcustomerset.Tables("customer").Columns("customerid")
ch = selectcustomerset.Tables("saledetail").Columns("customerid")
Dim myr As New DataRelation("myr", pa, ch)
selectcustomerset.Relations.Add(myr)
DataGrid1.SetDataBinding(selectcustomerset, "customer")
上面的代码是我自己写得,问题是only child grid都是"myr",我现在想要他显示子表中的字段