D
DraguVaso
Hi,
I have a ComboBox of +- 15.000 items in it, via a DataSource. On Top of the
Items-list, I want to add some values, based on a user choise (via a filter
on the DataSource). Does anybody know how I can do this? When just adding
them with ComboBox.items.Insert I get an "Items collection cannot be
modified when the DataSource property is set".
Does anybody has a solution for this? i'm surely not the first to do this
I'm using VB.NET 2005 Beta 2.
Thanks a lot in advance,
Pieter
This is my source:
Dim dtbl As New DataTable
dtbl = MyWorkSpace.GetAllArticlesClient(61)
Dim dtv As New DataView(dtbl)
dtv.Sort = "NomArticle"
Dim dtvF As New DataView(dtbl)
dtvF.RowFilter = "NomArticle LIKE '*HUILE*'"
dtvF.Sort = "NomArticle"
Me.cmbTest.DataSource = dtv
Me.cmbTest.DisplayMember = "NomArticle"
Me.cmbTest.ValueMember = "CodeArticle"
Dim intX As Integer
For intX = (dtvF.Count - 1) To 0 Step -1
cmbTest.Items.Insert(0, dtvF.Item(intX))
Next
I have a ComboBox of +- 15.000 items in it, via a DataSource. On Top of the
Items-list, I want to add some values, based on a user choise (via a filter
on the DataSource). Does anybody know how I can do this? When just adding
them with ComboBox.items.Insert I get an "Items collection cannot be
modified when the DataSource property is set".
Does anybody has a solution for this? i'm surely not the first to do this
I'm using VB.NET 2005 Beta 2.
Thanks a lot in advance,
Pieter
This is my source:
Dim dtbl As New DataTable
dtbl = MyWorkSpace.GetAllArticlesClient(61)
Dim dtv As New DataView(dtbl)
dtv.Sort = "NomArticle"
Dim dtvF As New DataView(dtbl)
dtvF.RowFilter = "NomArticle LIKE '*HUILE*'"
dtvF.Sort = "NomArticle"
Me.cmbTest.DataSource = dtv
Me.cmbTest.DisplayMember = "NomArticle"
Me.cmbTest.ValueMember = "CodeArticle"
Dim intX As Integer
For intX = (dtvF.Count - 1) To 0 Step -1
cmbTest.Items.Insert(0, dtvF.Item(intX))
Next