可扩展Gridview的问题 [英] Problem with Expandable Gridview

查看:55
本文介绍了可扩展Gridview的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了我的嵌套网格视图。



而不是嵌套网格,我想显示为可扩展的GridView。请帮帮我。



< blockquote  class  =   FQ>< div  class  = < span class =code-string>  FQA> Quote:< /   div  > < asp:GridView ID =    gvCustomers runat =   server AutoGenerateColumns =   False CssClass =  网格 
DataKeyNames = 状态
onselectedindexchanged = gvCustomers_Selecte dIndexChanged
BackColor = #DEBA84 BorderColor = #DEBA84 BorderStyle = 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 = 显示 />
< asp:Panel ID = pnlOrders runat = server可见= false样式= position:relative >
< asp:GridView ID = gvOrders runat = server AutoGenerateColumns = false PageSize = 5
AllowPaging = true OnPageIndexChanging = OnChildGrid_PageInde xChanging CssClass = ChildGrid > ;
< Columns>
< asp:BoundField ItemStyle-Width = 150px DataField = analysisId HeaderText = 分析标识 />
< asp:BoundField ItemStyle-Width = 150px DataField = alertId HeaderText = 警报ID />
< asp:BoundField ItemStyle-Width = 150px DataField = alertType HeaderText = 警报类型 />
< asp:BoundField ItemStyle-Width = 150px DataField = cveId HeaderText = CVD-ID />
< asp:BoundField ItemStyle-Width = 150px DataField = status HeaderText = 状态 />
< asp:BoundField ItemStyle-Width = 150px DataField = subStatus HeaderText = 子状态 />
< / >
< / asp:GridView >
< / asp:Panel >
< / ItemTemplate >
< / asp:TemplateField >
< asp:BoundField ItemStyle-Width = 150px DataField = alertType
HeaderText = <跨越ss =code-string> 警报类型 >
< ItemStyle Width = 150px > < / ItemStyle >
< / asp:BoundField >
< asp:BoundField ItemStyle-Width = 150px DataField = status HeaderText = 状态 >
< ItemStyle Width = 150px > < / ItemStyle >
< / asp:BoundField >
< asp:BoundField DataField = count HeaderText = 计数 />
< / >
< FooterStyle BackColor = #F7DFB5 ForeColor = #8C4510 />
< HeaderStyle BackColor = #A55129 Font-Bold = True ForeColor = 白色 />
< PagerStyle ForeColor = #8C4510 Horizo​​ntalAlign = 中心 />
< RowStyle BackColor = #FFF7E7 ForeColor = #8C4510 />
< SelectedRowStyle BackColor = #738A9C Font-Bold = True ForeColor = 白色 />
< SortedAscendingCellStyle BackColor = #FFF1D4 />
< SortedAscendingHeaderStyle BackColor = #B95C30 />
< SortedDescendingCellStyle BackColor = #F1E5CE />
< SortedDescendingHeaderStyle BackColor = #93451F />
< / asp:GridView > < / blockquote >

解决方案

检查一下

在GridView中显示可折叠数据 [ ^ ]


GridView中的可扩展行 [ ^ ]



ASPNet-Nested-GridViews-GridView-inside-GridView-with-Expand-and-Collapse-feature.aspx [ ^ ]

I have created my Nested Gridview.

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

<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>

解决方案

Check this one
Displaying Collapisble Data in GridView[^]


Expandable Rows in GridView[^]

ASPNet-Nested-GridViews-GridView-inside-GridView-with-Expand-and-Collapse-feature.aspx[^]


这篇关于可扩展Gridview的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆