' Create a ComboClass.vb
'================
Public Class CmbIdStr
Public txtShow As String
Public idValue As Integer
Public TextName As String
Sub New(ByVal pText As String, ByVal pidValue As Integer, ByVal pTestName As
String)
Me.txtShow = pText
Me.idValue = pidValue
Me.TextName = pTestName
End Sub
Overrides Function ToString() As String
Return txtShow
End Function
End Class
'=============
Private Sub AddMyEntry()
Dim cmbBox As ComboBox = MyCombo
OrdersBindingSource.RaiseListChangedEvents = False
cmbBox.Items.Add(New CmbIdStr("My Text", MyId.ToString,
MySecondID.ToString))
OrdersBindingSource.RaiseListChangedEvents = True
End Sub
--
remove underscore to send me mail, no spam
[quoted text, click to view] "Martin M" <nospam@no.spam.com> wrote in message
news:uagVd%231cIHA.2268@TK2MSFTNGP02.phx.gbl...
> Could try DaisyCombo from
www.springsys.com >
>
> -martin
>
>
>> I'm having difficulty binding a combobox which is of the dropdownstyle of
>> dropdown. According to documentation you can either select a value from
>> the
>> dropdown list or type a value into the textbox part of the control. If I
>> bind to the SelectedValue as in '.DataBindings.Add("Text", bsComp,
>> "Cage")' I
>> have absolutely no problem, but my requirement is that the user be able
>> to
>> save a non-listed value to the database. Since the string value in the
>> .Text
>> property is what I wanted to save, I tried to bind like a textbox but
>> that
>> doesn't work either. Any help would be appreciated.
>>
>> With Me.cboCageComp
>> .DataSource = cageTable
>> .DisplayMember = "Cage"
>> .ValueMember = "Cage"
>> .DataBindings.Add("Text", bsComp, "Cage")
>> End With
>
>