从下拉列表中选择所有项目 [英] Select all items from a dropdownlist
问题描述
我正在使用数据绑定下拉列表和放大器在EW4中创建一个表单。 gridview。我想添加选项"全部选择"对于不想在下拉列表中做出选择的用户的下拉列表。
如何添加选项"select all";到下拉列表,如何让选择显示de gridview中的所有相关数据?
谢谢。
< blockquote>
你应该在asp.net论坛上问这个。
简短的回答是,有很多方法:
最简单: &NBSP;选择全部选择,确保下拉列表设置为"多",为DDL创建和处理数据更改事件,并为列表中的所有项启用选择。
这是假设DDL是SQL数据源中的参数。
更难: 在数据bind()上,读取DDL的值,如果选择all,则适当地修改SQL并重新绑定。
I'm creating a form in EW4 using a databound dropdownlist & a gridview. I want to add the option "select all" to the dropdownlist for users who do not want to make a choice in the dropdownlist.
How do I add the option "select all" to the dropdownlist and how can I make that selection show all relevant data in de gridview?
Thanks.
You should ask this at the asp.net forums.
The short answer is, a number of ways:
Easiest: make a select that says select all, make sure the dropdownlist is set for "multi", create and handle an on-data-change event for the DDL and turn the selection on for all the items in the list.
This is assuming the DDL is a parameter in the SQL Data Source.
More difficult: On data bind(), read the value of the DDL, if its select all, modify the SQL appropriately and and rebind.
这篇关于从下拉列表中选择所有项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!