Hi, I have a problem with a databound listbox.. It seems that the listbox don't display numbers greater than 99..
My application stores missions with a certain number (a primary key as automatic idenditity seed in the db), when the number gets larger then 99 (100 or 101) it displays a star in the listbox instead of the number.
The listbox look like this:
*, value from db (value from db)
*, value from db (value from db)
99, value from db (value from db)
98, value from db (value from db)
97, value from db (value from db)
94, value from db (value from db)
93, value from db (value from db)
I've debugged it and found out that DT that I use as a DataSource shows 100 and 101 correctly. So there must be some kind av limit in the listbox or something.
My code for populating the listbox:
Dim DT As New DataTable
Dim TempDT As DataTable
' DT is correct!
DT = DBconn.GetDataTable(Command)
TempDT = DT.Copy
TempTable = TempDT.DefaultView
lbxArenden.DisplayMember = "LITEXT"
lbxArenden.ValueMember = "ORDERJOB_ID"
' I have tried to comment out this but it does not affect outcome
lbxArenden.DrawMode = DrawMode.OwnerDrawFixed
If lbxArenden.Items.Count > 0 Then
Dim TempItem As Integer
TempItem = lbxArenden.SelectedValue
lbxArenden.DataSource = DT
lbxArenden.SelectedValue = TempItem
Else
lbxArenden.DataSource = DT
End If
Anyone who has some magic?
My application stores missions with a certain number (a primary key as automatic idenditity seed in the db), when the number gets larger then 99 (100 or 101) it displays a star in the listbox instead of the number.
The listbox look like this:
*, value from db (value from db)
*, value from db (value from db)
99, value from db (value from db)
98, value from db (value from db)
97, value from db (value from db)
94, value from db (value from db)
93, value from db (value from db)
I've debugged it and found out that DT that I use as a DataSource shows 100 and 101 correctly. So there must be some kind av limit in the listbox or something.
My code for populating the listbox:
Dim DT As New DataTable
Dim TempDT As DataTable
' DT is correct!
DT = DBconn.GetDataTable(Command)
TempDT = DT.Copy
TempTable = TempDT.DefaultView
lbxArenden.DisplayMember = "LITEXT"
lbxArenden.ValueMember = "ORDERJOB_ID"
' I have tried to comment out this but it does not affect outcome
lbxArenden.DrawMode = DrawMode.OwnerDrawFixed
If lbxArenden.Items.Count > 0 Then
Dim TempItem As Integer
TempItem = lbxArenden.SelectedValue
lbxArenden.DataSource = DT
lbxArenden.SelectedValue = TempItem
Else
lbxArenden.DataSource = DT
End If
Anyone who has some magic?