如何使用复选框选择下拉gridlookup中的所有复选框以及从数据库中获取的项目 [英] How do I make a checkbox to select all checkbox on the dropdown gridlookup with items taken from the database

查看:222
本文介绍了如何使用复选框选择下拉gridlookup中的所有复选框以及从数据库中获取的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置复选框以选择下拉gridlookup中的所有复选框,其中包含从数据库中获取的项目,



示例:



< dx:ASPxGridLookup ID =GrLookUpEmprunat =serverClientInstanceName =GrLookUpEmpKeyFieldName =EmpNoSelectionMode =MultipleTextFormatString ={0}DataSourceID =SqlDataSource2 Width =250pxAllowUserInput =true>

< gridviewproperties>

< settings showfilterrow =True>



< columns>

< dx:gridviewcommandcolumn showselectcheckbox =Truexmlns:dx =#unknown>

< HeaderTemplate>

< dx:ASPxCheckBox ID =SelectAllProjectStatusChkbxClientEnabled =truerunat =serverToolTip =选择/取消选择页面上的所有行/>

< / HeaderTemplate>




< dx:gridviewdatacolumn fieldname =EmpNowidth =100%settings-autofiltercondition =包含xmlns:dx =#unknown >

< dx:gridviewdatacolumn fieldname =EmpNamewidth =100%settings-autofiltercondition =Containsxmlns:dx =#unknown>

< validationsettings validationgroup =validationTrusteerequiredfield-isrequired =true>

RequiredField-ErrorText =Display =DynamicCausesValidation =True>

< requiredfield isrequired =Trueerrortext =>



..





我想添加功能来选择标题复选框中存在的所有项目,是否以及如何?

解决方案

< pre lang =cs> FOR 选择所有 复选框.. 函数应在标题复选框上调用。

函数SelectAllCheckboxes1(chk){
debugger;


' #<%= WebDocumentGrid.ClientID%>')。find( input:checkbox)。each(function(){
if this != chk){
this checked = chk。已检查;
}
});

}

此函数应在脚本标记中简单地调用并为其分配checkall复选框和其他子复选框id。


。dummycb)。change( function(){
debugger;
var all =


How do I make a checkbox to select all checkbox on the dropdown gridlookup with items taken from the database,,

example :

<dx:ASPxGridLookup ID="GrLookUpEmp" runat="server" ClientInstanceName="GrLookUpEmp" KeyFieldName="EmpNo" SelectionMode="Multiple" TextFormatString="{0}" DataSourceID="SqlDataSource2" Width="250px" AllowUserInput="true">
<gridviewproperties>
<settings showfilterrow="True">

<columns>
<dx:gridviewcommandcolumn showselectcheckbox="True" xmlns:dx="#unknown">
<HeaderTemplate>
<dx:ASPxCheckBox ID="SelectAllProjectStatusChkbx" ClientEnabled="true" runat="server" ToolTip="Select/Unselect all rows on the page"/>
</HeaderTemplate>


<dx:gridviewdatacolumn fieldname="EmpNo" width="100%" settings-autofiltercondition="Contains" xmlns:dx="#unknown">
<dx:gridviewdatacolumn fieldname="EmpName" width="100%" settings-autofiltercondition="Contains" xmlns:dx="#unknown">
<validationsettings validationgroup="validationTrustee" requiredfield-isrequired="true">
RequiredField-ErrorText=" " Display="Dynamic" CausesValidation="True">
<requiredfield isrequired="True" errortext=" ">

..


I want to add functionality to select all the items that exist in the header checkbox, whether to and how?

解决方案

FOR ""Select ALL"" checkbox.. this function should be called on header checkbox.

 function SelectAllCheckboxes1(chk) {
            debugger;


('#<%=WebDocumentGrid.ClientID%>').find("input:checkbox").each(function () { if (this != chk) { this.checked = chk.checked; } }); } This function should be called simply in script tag and assign it the checkall checkbox and other child checkbox id.


(".dummycb").change(function () { debugger; var all =


这篇关于如何使用复选框选择下拉gridlookup中的所有复选框以及从数据库中获取的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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