如何使用C#重述dropdownlist [英] how to restate the dropdownlist using c#

查看:65
本文介绍了如何使用C#重述dropdownlist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dropdownlist1和一个commit按钮.
下拉列表的内容和顺序如下
1.选择
2.city
3.国家
我选择了城市,并在单击按钮下拉列表后将其单击.该按钮应位于命令上方.

I have a dropdownlist1 and a submit button.
dropdownlist contents and order as following
1.select
2.city
3.country
I have selected city and click the button after clicking the button dropdownlist should be above order.

推荐答案

假设该下拉列表包含以下顺序
Suppose the dropdownlist contains the follwing sequence
1.Select 
2.city
3.country



您正在选择城市,然后单击按钮,然后顺序应与以上相同.

要执行相同的操作
在按钮单击事件上编写以下代码.

this.DropDownList1.ClearSelection();

单击按钮后,您将获得与上述相同的顺序.



You are selecting city and click on button then the order should be like once again same as above.

To do the same
Write the following code on the button click event.

this.DropDownList1.ClearSelection();

After clicking on the button you will get the same sequence as above.


DropDownList1.ClearSelection();


Dropdownlist1.Selectedindex =0


这篇关于如何使用C#重述dropdownlist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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