将选择保存在列表框中 [英] Saving selections in a ListBox

查看:97
本文介绍了将选择保存在列表框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


从数据库值加载项目时,我必须列出列表框中的预选项目.如果我将多选值保存在表中,则当我在列表框中加载项目时,它会再次显示多选值.如果有人知道,请帮助我.


谢谢.

[edit]主题做了一个相关的摘要,而不是重复整个问题-OriginalGriff [/edit]

Hi,
I have to list out pre-selected items in listbox when i load items from database value. if i save multiselected values in table, its display that multiselected values again when i load items in listbox. If anybody know please help me.


Thanks.

[edit]Subject made a relevant summary, rather than the whole question repeated - OriginalGriff[/edit]

推荐答案



试试这个代码.它的工作.

li_category.Items.FindByValue(item.Value).Selected = True
Hi,

Try this code. Its working.

li_category.Items.FindByValue(item.Value).Selected = True


这篇关于将选择保存在列表框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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