如何在网格视图中添加一个复选框以进行组选择 [英] how to add a checkbox in a grid view for group seclection

查看:86
本文介绍了如何在网格视图中添加一个复选框以进行组选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在网格视图中添加一个复选框以进行组选择

当我点击一个headertext复选框时,它必须选择所有的行网格视图

PLZ帮助我

感谢您的重播

解决方案

您可以使用模板字段来完成。



参考: MS ASP.NET:添加一个GridView的复选框列(C#) [ ^ ]


 <   asp:gridview     id   =  Grid_View1    runat   =  服务器 >  
< >
< templatefield < span class =code-attribute> headertext = ID 可见 = false >
< itemtemplate > < asp:复选框 id = Check_You_Box runat = 服务器 已检查 = true > < / itemtemplate > < span class =code-keyword>< / templatefield >



< / columns > < / asp:GridView >









这只是我可以提供的回报您提供的信息:)



问候

Daman

SkypeId:nik_boyz


 <   asp:gridview     id   =  Grid_View1    runat   =   server    xmlns:asp   = #unknown >  
< >
< templatefield headertext = ID visible = false >
< itemtemplate > < asp:checkboxlist < span class =code-attribute> id = Check_You_Box runat = 服务器 已检查 = true > < asp:listitem value = 00 > 选择< / asp:listitem > < asp:listitem value = 01 > 选项1 < / asp:listitem > < / asp:checkboxlist > < / itemtemplate > < / templatefield >



< / columns > < / asp:gridview >


hi,
how to add a checkbox in a grid view for group selection
that is when i click on a headertext check box it must select all the rows in the grid view
PLZ HELP ME
thanks for ur replay

解决方案

You can do it using Template fields.

Refer: MS ASP.NET: Adding a GridView Column of Checkboxes (C#)[^]


<asp:gridview id="Grid_View1" runat="server">
<columns>
                                <templatefield headertext="ID" visible="false">
                                    <itemtemplate><asp:checkbox id="Check_You_Box" runat="Server" checked="true"></itemtemplate></templatefield>



</columns></asp:GridView>





This is only i can provide in return of the information provided by you :)

Regards
Daman
SkypeId: nik_boyz


<asp:gridview id="Grid_View1" runat="server" xmlns:asp="#unknown">
<columns>
                                <templatefield headertext="ID" visible="false">
                                    <itemtemplate><asp:checkboxlist id="Check_You_Box" runat="Server" checked="true"><asp:listitem value="00">Select</asp:listitem><asp:listitem value="01">Option1</asp:listitem></asp:checkboxlist></itemtemplate></templatefield>
 

 
</columns></asp:gridview>


这篇关于如何在网格视图中添加一个复选框以进行组选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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