很简单的问题,ListBox问题:如何删除ListBox中选定的项,注意:此选定的项与数据库绑定
用lstbox1.Items.remove(this.lstbox1.SelectItem)不行
报错:Can't modify the Items collection when the DataSource property is set.
问题点数:20、回复次数:6Top
1 楼seani(Jason)回复于 2002-11-08 15:28:21 得分 0
怎么没人回答,急呀Top
2 楼seani(Jason)回复于 2002-11-08 16:22:40 得分 0
斑竹????Top
3 楼haxiu(哈休)回复于 2002-11-08 17:25:43 得分 10
删除数据库的这一项,然后重新绑定Top
4 楼seani(Jason)回复于 2002-11-08 17:32:01 得分 0
能否给个例子,我绑定的是结构数组Top
5 楼dy_2000_abc(芝麻开门)回复于 2002-11-08 22:29:51 得分 10
int index=this.BindingContext[this.lstbox1.DataSource].Position;
this.BindingContext[this.lstbox1.DataSource].RemoveAt(index);Top
6 楼seani(Jason)回复于 2002-11-11 16:52:25 得分 0
dy_2000_abc(芝麻开门) ( ).不行,异常呀
我是数据绑定Top




