2012-05-22 94 views
0

我想使用可以擴展其行的網格視圖,也應該能夠擴展內部的行。所以基本上我想看到三個層面的信息。我在Google上看到了很多工具,但它們不是免費的,或者它們不會達到第三級。我也不想使用樹網格查看任何意見,將不勝感激。可擴展Gridview

在此先感謝

這是我到目前爲止有:

    <asp:TemplateField> 
       <ItemStyle CssClass="inv" Width="0" /> 
       <HeaderStyle CssClass="inv" Width="0"></HeaderStyle> 
       <HeaderTemplate> 
        </th></tr></HeaderTemplate> 
       <ItemTemplate> 
        </td> 
        <asp:PlaceHolder ID="Project" runat="server" Visible="False"> 
         <tr> 
          <td colspan="1" style="border: 0px solid #fff; background-color: transparent;"> 
          </td> 
          <td colspan="9" style="padding: 0px; padding-top: 3px; padding-bottom: 7px; border-right-width: 0px; 
           border-bottom-width: 0px; background-color: #FFFFFF;"> 
           <asp:UpdatePanel runat="server" ID="ChildControl"> 
            <ContentTemplate> 
             <asp:LinkButton ID="lbtnAddDeliverable" runat="server" OnClick="lbtnAddDeliverable_Click" 
              Height="17px">Add Deliverable </asp:LinkButton>&nbsp; &nbsp; 
             <asp:GridView ID="grid0" runat="server" AllowPaging="True" DataKeyNames="DeliverableID" 
              AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" 
              OnRowDataBound="grid0RowDataBound" 
              OnRowCommand="grid0_RowCommand" Width="970px" DataSourceID="odsGetDelivbyProjects"> 
              <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> 
              <Columns> 
               <asp:BoundField DataField="DeliverableID" HeaderText="DeliverableID" SortExpression="DeliverableID" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" 
                HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible"> 
                <HeaderStyle CssClass="invisible" /> 
                <ItemStyle CssClass="invisible" /> 
               </asp:BoundField> 
               <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" HeaderStyle-CssClass="invisible" ItemStyle-CssClass="invisible" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/> 
               <asp:TemplateField HeaderText="Name" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> 
                <ItemTemplate> 
                 <asp:LinkButton ID="lbtnEditDeliverable" CommandName="EditDeliverable" runat="server" OnClick="lbtnEditDeliverable_Click"> Edit Deliverable</asp:LinkButton> 
                </ItemTemplate> 
               </asp:TemplateField> 
               <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/> 
               <asp:BoundField DataField="StartDate" HeaderText="StartDate" SortExpression="StartDate" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/> 
               <asp:BoundField DataField="EndDate" HeaderText="EndDate" SortExpression="EndDate" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/> 

               <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> 
                <ItemTemplate> 
                 <asp:LinkButton ID="lbtnAddDelivResource" CommandName="DeliverableResource" runat="server" OnClick="lbtnAddDelivResource_Click"> Add Resources</asp:LinkButton> 
                </ItemTemplate> 
               </asp:TemplateField> 
               <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> 
       <ItemTemplate> 
        <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" 
         Text="Delete" OnClientClick="return confirm('Are you certain you want to delete this Delivirable?');"> 
        </asp:LinkButton> 
       </ItemTemplate> 
      </asp:TemplateField> 
               <%--        <asp:TemplateField HeaderText=""> 
       <ItemTemplate> 
      <asp:LinkButton ID="lbtnAddDeliverable" runat="server" OnClick="lbtnAddDeliverable_Click" 
     Height="17px">Add Deliverable </asp:LinkButton> 
        </ItemTemplate> 
      </asp:TemplateField>--%> 
              </Columns> 
              <EditRowStyle BackColor="#999999" /> 
              <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 
              <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 
              <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> 
              <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> 
              <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> 
              <SortedAscendingCellStyle BackColor="#E9E7E2" /> 
              <SortedAscendingHeaderStyle BackColor="#506C8C" /> 
              <SortedDescendingCellStyle BackColor="#FFFDF8" /> 
              <SortedDescendingHeaderStyle BackColor="#6F8DAE" /> 
             </asp:GridView> 
             <borderskin bordercolor="Transparent" /> 
             <div class="graph_aux" style="font-size: .7em;"> 
              <span></span> 
             </div> 
             <asp:ObjectDataSource ID="odsGetDelivbyProjects" runat="server" SelectMethod="CallDeliverableDetails" 
              TypeName="Pbel_Resource_Management.Classes.Object_Classes.Projects.ProjectCalls"> 
              <SelectParameters> 
               <asp:SessionParameter Name="ProjectID" SessionField="DeliverableFromProject" Type="Int32" /> 
              </SelectParameters> 
             </asp:ObjectDataSource> 
            </ContentTemplate> 
           </asp:UpdatePanel> 
          </td> 
         </tr> 
        </asp:PlaceHolder> 
       </ItemTemplate> 
      </asp:TemplateField> 

回答

2

你可以做到這一點爲Tree like Gridview « Teme on .NET

+0

它像GridView中樹我想避免的,我們是不允許使用它,所以現在我必須找到另一種方式:( –

+0

對不起@如果它是沒有幫助的被遺棄;它究竟應該是什麼?任何例子? –

+0

其確定亞西爾的帖子將是非常有益的,如果它被允許是我的初始從這個例子我知道它是一個gridview內的gridview內的gridview ...這對我來說似乎很多餘,但我只是一個初級,所以我不能爭辯 –