我用DataGrid实现过类似的功能,办法是在DataGrid中再嵌套DataGrid,这样可以用“学科分类”表绑定外层DataGrid,再将“详细分类”表根据“学科分类”建立多个DataView,然后用每个DataView邦定里层的DataGrid。我不知道说清楚了没有,如果需要我可以把代码给你。

解决方案 »

  1.   

    >>>将“详细分类”表根据“学科分类”建立多个DataView??retrieve the data into two tables, create a relationship between ID of 学科分类 with classID of 详细分类, use nested repeater or datagrid, see
    HOW TO: Display Hierarchical Data by Using Nested Repeater Controls and Visual C# .NET
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;306154Hierarchical Data Binding in ASP.NET
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspn-hierdatabinding.asp