| 发表于:2007-03-02 14:53:3910楼 得分:0 |
cbl.items.add(new listitem( "a ", "1 ")); cbl.items.add(new listitem( "b ", "2 ")); cbl.items.add(new listitem( "c ", "3 ")); cbl.items.add(new listitem( "d ", "4 ")); cbl.items.add(new listitem( "e ", "5 ")); cbl.items.add(new listitem( "f ", "6 ")); cbl.items.add(new listitem( "x ", "18 ")); string[] sortid = "1,2,3,4,5,18 ".split( ", ".tochararray());//从数据库读出 int iindex; for (int i = 0; i < sortid.length; i++) { iindex = cbl.items.indexof(cbl.items.findbyvalue(sortid[i])); if (iindex != -1) { cbl.items[iindex].selected = true; } } 没问题啊! | | |
|