添加复选框 [英] adding a checkboxlist
本文介绍了添加复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将复选框列表添加到标准gridview.当我将其从工具箱中拖放到网格中时,什么也没有发生.我相信有一种比程序设计更简单的方法.仅在工具箱的帮助下,我该怎么做.或者,如果唯一的选择是编码,那么编码是什么.
how do I add a checkboxlist to a standard gridview. When I drag it from the tool box and drop it in the grid nothing happens. i believe there is an easier way than doing programaticcaly. How do I do it just with the help of the tool box. or if the only choice is coding then what is the code.
推荐答案
您可以在gridview中使用templatefield
Hi,
You can use templatefield in gridview
<asp:gridview>
<columns>
<asp:templatefield>
<itemtemplate>
<asp:checkboxlist>
</itemtemplate>
</columns>
复制并粘贴到您的gridview内
Copy and paste inside your gridview
<Columns>
<asp:TemplateField HeaderText="select">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Width="50px" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="chkAll" runat="server" Text="Select"/></td>
</HeaderTemplate>
</asp:TemplateField>
</Columns>
这篇关于添加复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文