在C#中删除listbox.datasource [英] Remove in c#, listbox.datasource

查看:148
本文介绍了在C#中删除listbox.datasource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#

推荐答案

中将数据源分配给列表框后,如何从列表框中删除选定的项.

Locate the item in your datasource and then remove it from that datasource.

mySource.RemoveAt(FindItem());
myListBox.DataSource = mySource;


请参阅以下内容:

http: //stack-flow.com/questions/709562/how-to-remove-selected-items-from-listbox-when-a-datasource-is-assigned-to-it-in [ http://pastebin.com/euKJYb4Q [ ^ ]

Refer these:

http://stackoverflow.com/questions/709562/how-to-remove-selected-items-from-listbox-when-a-datasource-is-assigned-to-it-in[^]

http://pastebin.com/euKJYb4Q[^]

http://www.binrand.com/post/119967-activities-how-to-remove-selected-items-from-listbox-when-a-datasource-is-assigned-to-it-in-c.html[^]


您能否进一步说明一下那..我正在尝试实现,但我不能
因此,我有一个带有"listbox1.datasource = datafile"项的列表框,此CODO获取元素并将其放置在listbox1中,现在从此列表框中即为:
AAAAA
-----
BBBBB
-----

我想删除那些行"-------";分配数据源时这怎么可能?
Can you be more specifike about that.. I am trying to implement but I cant
So I have listbox with item " listbox1.datasource=datafile" this codo get elements and put them in listbox1, now from this list box that is:
AAAAA
-----
BBBBB
-----

I want to remove those lines "-------"; how is that impposible when datasource is assigned ?


这篇关于在C#中删除listbox.datasource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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