会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
luqingfei@.net
首页
新随笔
联系
管理
枚举类型作为数据源绑定到dropdownlist控件
主要运用到System.Enum命名空间下的两个方法: GetValues(), GetName.
BindState
#region
BindState
/**/
///
<summary>
///
绑定出差状态
///
</summary>
private
void
BindState()
{
foreach
(
int
i
in
System.Enum.GetValues(
typeof
(EvectionState)))
{
string
text
=
System.Enum.GetName(
typeof
(EvectionState), i);
this
.ddlState.Items.Add(
new
ListItem(text, i.ToString()));
}
this
.ddlState.Items.Insert(
0
,
new
ListItem());
}
#endregion
posted on
2007-07-06 10:44
Louis.Lu.Sz
阅读(
536
) 评论(
1
)
收藏
举报
刷新页面
返回顶部