当AppendDataBoundItems = true时,DropdownList保留值; [英] DropdownList retains value when AppendDataBoundItems = true;

查看:81
本文介绍了当AppendDataBoundItems = true时,DropdownList保留值;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据绑定Dropdownlist,根据活跃用户过滤数据,

我想在下拉列表中显示项目前放置一个初始值



为了显示初始值,



我设置了AppendDataBoundItems = true;



它现在显示初始值,问题是,当我更改用户时,下拉列表中的值保留其先前的值并从新选择中添加新值。



还有其他方法可以在数据绑定下拉列表中选择或选择初始值吗?

I have a databound Dropdownlist, which the data is filtered based on the active user,
I wanted to place an initial value before the items are displayed at the dropdown

in order for the initial value to be displayed,

I have set AppendDataBoundItems = true;

It is now displaying the initial value, the problem is, when I change the user, the values inside the dropdown list retains its previous values and add new values from the new selection.

Is there any other way to include an "INITIAL VALUE" like choose or select on a databound dropdown list?

推荐答案

再次绑定之前调用 Dropdownlist.Items.Clear();


这篇关于当AppendDataBoundItems = true时,DropdownList保留值;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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