日期:2014-05-18  浏览次数:20489 次

GridView显示层级菜单(在线等)
小弟想在GridView里把数据库里的类别菜单显示出来。但菜单包含大小类,如何按大小类的层级关系显示出来,各位打侠帮帮忙,这个问题小弟我从昨天搞到现在没搞出来。

------解决方案--------------------
GridView里嵌套GridView
<asp:GridView ID="gvFilmBase" runat="server" AutoGenerateColumns="False" Width="100%" OnRowDataBound="gvFilmBase_RowDataBound" AllowPaging="True" OnPageIndexChanging="gvFilmBase_PageIndexChanging" OnRowCreated="gvFilmBase_RowCreated" PageSize="13">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<table
borderColor="#ffffff" cellSpacing="0" cellPadding="0" width="100%" style="border-left-width: 1px; border-left-color: #ff99ff; border-top-style: none; border-right-width: 1px; border-right-color: #99ccff; border-bottom-style: none" border="0">
<tr>
<td align="center" width="3%" style="height: 30px">
</td>
<td align="center" width="7%" style="height: 30px">
编号</td>
<td align="center" width="15%" style="height: 30px">
类型</td>
<td align="center" width="35%" style="height: 30px">
影片名称</td>
<td align="center" width="25%" style="height: 30px">
加入时间</td>
<td align="center" width="15%" style="height: 30px">
作者</td>
</tr>
</table>

</HeaderTemplate>
<ItemTemplate>
<table style="width: 100%; border-top-style:none; border-bottom-style: none; border-top-color: #ffffff; border-collapse: collapse; border-left-width: 1px; border-left-color: #9933ff; border-right-width: 1px; border-right-color: #9900ff;">
<tr>
<td style="height: 20px" width="3%" align="center"><DIV style="CURSOR: hand" onclick="ShowDetail(this);">+</DIV>
</td>
<td style="height: 20px" width="7%" align="center">
<asp:Label ID="lbNum" runat="server" Text='<%# Eval("ID") %>'></asp:Label></td>
<td style="height: 20px; width: 15%;" align="center">
<asp:Label ID="lbSort" runat="server" Text='<%# Eval("Sort") %>'></asp:L