asp.net gridview如何实现展开折叠效果(求源码)
1个回答
展开全部
<asp:GridView ID="gvTab" BackColor="WhiteSmoke" runat="server" AutoGenerateColumns="False" GridLines="Vertical"
2 ShowFooter="True">
3 <Columns>
4 <asp:TemplateField>
5 <HeaderStyle Width="25px" />
6 <ItemStyle Width="25px" BackColor="White" />
7 <HeaderTemplate>
8 <asp:Image ID="imgTab" onclick="javascript:Toggle(this);" runat="server" ImageUrl="~/minus.gif"
9 ToolTip="Collapse" />
10 </HeaderTemplate>
11 </asp:TemplateField>
12 <asp:BoundField HeaderText="n" DataField="n">
13 <HeaderStyle Width="25px" />
14 <ItemStyle Width="25px" />
15 </asp:BoundField>
16 <asp:BoundField HeaderText="sqrt(n)" DataField="sqrtn">
17 <HeaderStyle Width="150px" />
18 <ItemStyle Width="150px" />
19 </asp:BoundField>
20 <asp:BoundField HeaderText="qbrt(n)" DataField="qbrtn">
21 <HeaderStyle Width="150px" />
22 <ItemStyle Width="150px" />
23 </asp:BoundField>
24 </Columns>
25 <HeaderStyle Height="25px" Font-Bold="True" BackColor="DimGray" ForeColor="White" HorizontalAlign="Center"
26 VerticalAlign="Middle" />
27 <RowStyle Height="25px" BackColor="Gainsboro" HorizontalAlign="Center" VerticalAlign="Middle" />
28 <AlternatingRowStyle Height="25px" BackColor="LightGray" HorizontalAlign="Center" VerticalAlign="Middle" />
29 <FooterStyle BackColor="Gray" />
30</asp:GridView>
2 ShowFooter="True">
3 <Columns>
4 <asp:TemplateField>
5 <HeaderStyle Width="25px" />
6 <ItemStyle Width="25px" BackColor="White" />
7 <HeaderTemplate>
8 <asp:Image ID="imgTab" onclick="javascript:Toggle(this);" runat="server" ImageUrl="~/minus.gif"
9 ToolTip="Collapse" />
10 </HeaderTemplate>
11 </asp:TemplateField>
12 <asp:BoundField HeaderText="n" DataField="n">
13 <HeaderStyle Width="25px" />
14 <ItemStyle Width="25px" />
15 </asp:BoundField>
16 <asp:BoundField HeaderText="sqrt(n)" DataField="sqrtn">
17 <HeaderStyle Width="150px" />
18 <ItemStyle Width="150px" />
19 </asp:BoundField>
20 <asp:BoundField HeaderText="qbrt(n)" DataField="qbrtn">
21 <HeaderStyle Width="150px" />
22 <ItemStyle Width="150px" />
23 </asp:BoundField>
24 </Columns>
25 <HeaderStyle Height="25px" Font-Bold="True" BackColor="DimGray" ForeColor="White" HorizontalAlign="Center"
26 VerticalAlign="Middle" />
27 <RowStyle Height="25px" BackColor="Gainsboro" HorizontalAlign="Center" VerticalAlign="Middle" />
28 <AlternatingRowStyle Height="25px" BackColor="LightGray" HorizontalAlign="Center" VerticalAlign="Middle" />
29 <FooterStyle BackColor="Gray" />
30</asp:GridView>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询