删除下拉列表中的值............................................ ............... [英] remove value in drop down list...........................................................

查看:111
本文介绍了删除下拉列表中的值............................................ ...............的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我说英语不好,我希望我能说得好



我的项目中有一个下拉列表(asp.net)框架4(c#))

我想删除这些drop的一些值

用户可以从drop中选择一个值来删除它

drop的值是分层的,父母和孩子



我不知道该怎么办

请帮帮我
谢谢

hi I can not speak good English,I wish I could say good

I have a drop down list in my project(asp.net framework 4 (c#))
I want to remove some value of these drop
The user could select a value from drop to remove it
The values ​​of drop is hierarchically,The parent and child

I do not know how to do
Please help me
Thank you

推荐答案

DropDownList的文档说你可以使用删除 RemoveAt 方法。



ListItemCollection类



删除当前选定的项目

The documentation for DropDownList says you can use the Remove or RemoveAt methods.

ListItemCollection Class

Remove the currently selected item
lstReservations.Items.RemoveAt(lstReservations.SelectedIndex)





在Visual Studio中,您可以单击帮助菜单项,然后查看帮助以访问每个.NET Framework类的帮助文件信息。许多帮助文件条目都有小例子。



In Visual Studio, you can click the Help menu item, then View Help to access the help file information for each of the .NET Framework Classes. Many of the help file entries have small examples.


这篇关于删除下拉列表中的值............................................ ...............的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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