Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created my Nested Gridview.

Instead of nested grid, I want to showing as expandable GridView. Please help me.

C#
<blockquote class="FQ"><div class="FQA">Quote:</div><asp:GridView ID="gvCustomers" runat="server" AutoGenerateColumns="False" CssClass="Grid"
    DataKeyNames="status" 
      onselectedindexchanged="gvCustomers_SelectedIndexChanged" 
      BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
      CellPadding="3" CellSpacing="2">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:ImageButton ID="imgShow" runat="server" OnClick="Show_Hide_ChildGrid" ImageUrl="~/Images/plus.png"
                    CommandArgument="Show" />
                <asp:Panel ID="pnlOrders" runat="server" Visible="false" Style="position: relative">
                    <asp:GridView ID="gvOrders" runat="server" AutoGenerateColumns="false" PageSize="5"
                        AllowPaging="true" OnPageIndexChanging="OnChildGrid_PageIndexChanging" CssClass="ChildGrid">
                        <Columns>
                            <asp:BoundField ItemStyle-Width="150px" DataField="analysisId" HeaderText="Analysis Id" />
                            <asp:BoundField ItemStyle-Width="150px" DataField="alertId" HeaderText="Alert Id" />
                            <asp:BoundField ItemStyle-Width="150px" DataField="alertType" HeaderText="Alert Type" />
                            <asp:BoundField ItemStyle-Width="150px" DataField="cveId" HeaderText="CVD-ID" />
                            <asp:BoundField ItemStyle-Width="150px" DataField="status" HeaderText="Status" />
                            <asp:BoundField ItemStyle-Width="150px" DataField="subStatus" HeaderText="Sub Status" />
                        </Columns>
                    </asp:GridView>
                </asp:Panel>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField ItemStyle-Width="150px" DataField="alertType" 
            HeaderText="Alert Type" >
<ItemStyle Width="150px"></ItemStyle>
        </asp:BoundField>
        <asp:BoundField ItemStyle-Width="150px" DataField="status" HeaderText="Status" >
<ItemStyle Width="150px"></ItemStyle>
        </asp:BoundField>
        <asp:BoundField DataField="count" HeaderText="Count" />
    </Columns>
    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#FFF1D4" />
    <SortedAscendingHeaderStyle BackColor="#B95C30" />
    <SortedDescendingCellStyle BackColor="#F1E5CE" />
    <SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView></blockquote>
Posted
Comments
[no name] 19-Oct-13 5:24am    
Are u looking for expandable Rows in GridView ..??
srmohanr 19-Oct-13 5:27am    
Yes. Please help me

 
Share this answer
 
Comments
srmohanr 20-Oct-13 0:17am    
I have tried, but I am still getting this as a nested gridview and it's not showing as a new row(as expandable)
thatraja 22-Oct-13 5:54am    
Include more details, if possible add screenshot. So that we could spot the issues.
 
Share this answer
 
Comments
srmohanr 20-Oct-13 0:17am    
I have tried, but I am still getting this as a nested gridview and it's not showing as a new row(as expandable)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900