使用带有listview控件的复选框进行多项选择 [英] using checkboxes with listview control to make multiple selection

查看:96
本文介绍了使用带有listview控件的复选框进行多项选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友您好,我对将复选框与Listview控件一起使用有疑问.
我正在使用listview控件中的复选框.
我想在这里提供2种功能.
1.列表视图外部的复选框,选择此复选框后,必须选中所有数据以删除.
2. listview控件中每一行之前的复选框,以进行多项选择.
我无法访问复选框选择上的行ID.我该怎么办.
请帮帮我.
在此先感谢

hello friends i have a problem regarding using checkboxes with listview control.
i am using checkboxes in listview control .
i want to give 2 functionalities here.
1. A checkbox outside the listview , on selection of this all the data must be selected for deletion.
2. a checkbox before every row in listview control , to make multiple selection .
i am not able to access the id of row on checkbox selection .how can i do it .
Please help me .
Thanks in advance

推荐答案

hi.

试试这个链接.
列出/检查属性


希望对您有帮助.
祝你好运!.


-chaosgray-
hi.

try this link.
list/check properties


hope it helps.
goodluck!.


-chaosgray-


1.对于内部复选框,您需要在选中该复选框时为记录(行)标识ID(或主键),然后可以将此ID存储在隐藏的控件中(以逗号分隔的格式).您可以使用JQuery进行此操作,我正在发布用于添加ID值的代码,希望您可以编写逻辑来删除ID(在取消选中复选框的情况下):

1. For inner check boxes, you need to identify the ID (or primary key) for the record (row) on check of that check-box and then you can store this ID in a hidden control (in comma separated format). You can do this using JQuery, I''m posting code for adding the ID value, hope you can write logic for ID removal (on uncheck of checkbox):

var ctrlValue =


(" #hdn").val(); ctrlValue = ctrlValue +
("#hdn").val(); ctrlValue = ctrlValue +


这篇关于使用带有listview控件的复选框进行多项选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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