如何将+/-按钮添加到gridview以进行展开和折叠(与下面链接中的代码相关) [英] how to add +/- button to a gridview for expanding and collapsing it( in relationship to the code in the link below)

查看:63
本文介绍了如何将+/-按钮添加到gridview以进行展开和折叠(与下面链接中的代码相关)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将+/-按钮添加到gridview以进行展开和折叠(与下面链接中的代码相关)

[ ^ ]

解决方案

要使GridView使用您提供的链接中的代码,您至少需要以下设置。

 <   asp:GridView     ID   =  GridView1    runat   =  server    OnRowCommand   =  GridView1_RowCommand    OnRowCreated   =  GridView1_RowCreated    OnRowDataBound   =  GridView1_RowDataBound >  
< < span class =code-leadattribute>列 >
< asp:TemplateField HeaderText = <跨度class =code-keyword> Root >
< ItemTemplate >
< asp:按钮 ID = MinBT runat = server CommandName = _隐藏 文本 = - / >
< asp:按钮 ID = PluseBT runat = 服务器 CommandName = _ Show 文字 = + 可见 = false / >
< / ItemTemplate >
< / asp:TemplateField >
< /列 >
< / asp:GridView >


how to add +/- button to a gridview for expanding and collapsing it( in relationship to the code in the link below)
How to Create TreeView Type GridView[^]

解决方案

For the GridView to work with the code in the link you provided you need, at minimum, the following settings.

<asp:GridView ID="GridView1" runat="server" OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated" OnRowDataBound="GridView1_RowDataBound">
<Columns>
    <asp:TemplateField HeaderText="Root">
        <ItemTemplate>
            <asp:Button ID="MinBT" runat="server" CommandName="_Hide" Text="-" />
            <asp:Button ID="PluseBT" runat="server" CommandName="_Show" Text="+" Visible="false"/>
        </ItemTemplate>
    </asp:TemplateField>
</Columns>
</asp:GridView>


这篇关于如何将+/-按钮添加到gridview以进行展开和折叠(与下面链接中的代码相关)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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