Combobox text not in list strange behaviour
From: clorentson (clorentson_at_discussions.microsoft.com)
Date: 03/23/05
- Next message: Fr. Robert: "corrupted net 1.1 framework install"
- Previous message: Mark: "HttpWebRequest ->HttpWebResponse question"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Mar 2005 11:57:01 -0800
Here is a weird one. I have a combobox that accepts and displays values that
are not in the list. However if I do a droppedDown = true in the onEnter
event handler and then tab to another combobox, the text value is reset to
null/empty string. My solution at this point is to separate the two
comboboxes with a textbox so that doesn't happen. (Note that it also resets
to null if i step through through the droppeddown = true statement.)
If anyone has seen this or heard of fix for it, please let me know.
Thanks,
Carl
Here are code snippets pertainent to this:
'
'cboPaymentType
'
Me.cboPaymentType.Enabled = False
Me.cboPaymentType.Location = New System.Drawing.Point(152, 160)
Me.cboPaymentType.Name = "cboPaymentType"
Me.cboPaymentType.Size = New System.Drawing.Size(104, 21)
Me.cboPaymentType.TabIndex = 2
'
'cboPaymentMethod
'
Me.cboPaymentMethod.Enabled = False
Me.cboPaymentMethod.Location = New System.Drawing.Point(320, 160)
Me.cboPaymentMethod.Name = "cboPaymentMethod"
Me.cboPaymentMethod.Size = New System.Drawing.Size(104, 21)
Me.cboPaymentMethod.TabIndex = 4
'payment type
Me.cboPaymentType.DataBindings.Add("SelectedValue", Me.OrderDS,
"Orders.OrdersOrderPayments.PaymentTypeFK")
' binding to the Text property appears to allow a value not in the
list to be entered, saved, and displayed.
Me.cboPaymentType.DataBindings.Add("Text", Me.OrderDS,
"Orders.OrdersOrderPayments.PaymentTypeFK")
Me.cboPaymentType.DataSource = Me.PaymentTypeDS
Me.cboPaymentType.DisplayMember = "PaymentType.PaymentTypeName"
Me.cboPaymentType.ValueMember = "PaymentType.PaymentTypeName"
' do it twice to get around bug
Me.cboPaymentType.SelectedIndex = -1
Me.cboPaymentType.SelectedIndex = -1
'payment method
Me.cboPaymentMethod.DataBindings.Add("SelectedValue", Me.OrderDS,
"Orders.OrdersOrderPayments.PaymentMethodFK")
' binding to the Text property appears to allow a value not in the
list to be entered, saved, and displayed.
Me.cboPaymentMethod.DataBindings.Add("Text", Me.OrderDS,
"Orders.OrdersOrderPayments.PaymentMethodFK")
Me.cboPaymentMethod.DataSource = Me.PaymentMethodDS
Me.cboPaymentMethod.DisplayMember = "PaymentMethod.PaymentMethodName"
Me.cboPaymentMethod.ValueMember = "PaymentMethod.PaymentMethodName"
' do it twice to get around bug
Me.cboPaymentMethod.SelectedIndex = -1
Me.cboPaymentMethod.SelectedIndex = -1
Private Sub cboPaymentMethod_Enter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cboPaymentMethod.Enter
CType(sender, ComboBox).DroppedDown = True
End Sub
Private Sub cboPaymentType_Enter(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cboPaymentType.Enter
CType(sender, ComboBox).DroppedDown = True
End Sub
- Next message: Fr. Robert: "corrupted net 1.1 framework install"
- Previous message: Mark: "HttpWebRequest ->HttpWebResponse question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|