This is a small problem, but it took me some time. It seems that some small knowledge points have to be concerned.
Problem: the data obtained from the database is bound to the dropdownlist, And the dropdownlist write is dead. As long as it matches the data in the database, some items are selected by default. The data can be read normally, but it will appear in the dropdwonlist.
You cannot select multiple items in dropdownlist to report an error.
At first, I thought there was a problem with the data and business logic in the database. After checking, I found that there was no problem. I looked for the dropdownlist help and finally found a good thing.
Clearselection ()
In addition, it will not cause problems: dropcurrencetype. clearselection ();
In addition, some friends asked how to bind the data as updated to the dropdownlist, which is actually quite simple.
Dropcurrencetype. Items. findbyvalue (spinfo. currencytype. tostring (). Trim (). Selected = true;
Dropcurrencetype. Items. findbytext (spinfo. currencytype. tostring (). Trim (). Selected = true;
I would like to share with you a little bit of knowledge.
This article from: http://www.dezai.net/blog/blogview.asp? Logid = 194
Http://www.cnblogs.com/eastjazz/archive/2008/05/08/1188146.html