在自定义下拉列表中添加默认值 [英] Add default value in a custom drop down list

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

问题描述

我想向自定义下拉列表中添加默认值,但该值不应出现在列表中.仅当我不选择任何内容时,它才应出现在该控件中.

I want to add a default value to my custom drop down list, but this value should NOT appear in my list.It should only appear in that control when i dont select anything.

推荐答案

为什么不将空的listitem添加到默认选择的ddl中


why don''t you add an empty listitem to the ddl selected by default


ddl.Items.Insert(0, "");
ddl.ClearSelection();
ddl.SelectedIndex = 0;



听起来很奇怪,没有选择.

我知道它确实出现在ddl中.
但这似乎更标准"



sounds weird a dropdown with no selection.

i know that it does appear in the ddl.
but that seems more "standard"


这篇关于在自定义下拉列表中添加默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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