|
-
Mar 26th, 2003, 10:40 AM
#1
Thread Starter
Frenzied Member
ComboBox and updating data
I have a ComboBox that is data bound to a particular Dataset's table and column. When the DropDownStyle is DropDownList, a user's changes to the field are not recognized.
Changing the DropDownStyle to DropDown - things work just fine - either by selecting from the list or manually typing.
The latter is not an option, as I need to restrict the possible values. What am I missing here? Any ideas are appreciated.
Mike
-
Mar 26th, 2003, 11:30 AM
#2
Sleep mode
Re: ComboBox and updating data
I had quite similar problem with DropDownList . I was trying to get the selected item by the user like this :
MsgBox(ComboBox4.SelectedItem()) and always throw an exception but when I changed the dropping style to ropDown it works . at the end I used this :
MsgBox(ComboBox4.Text) along with DropDownList property and worked fine . I dunno if this would give you any clue or not !
-
Mar 26th, 2003, 12:32 PM
#3
Thread Starter
Frenzied Member
Well, it helped in that I know I'm not doing something really stupid, seems like there's a problem when setting the DropDownStyle to DropDownList.
Got around the problem by manually (through code, that is) updating the dataset's table/row/column with the Text property of the ComboBox.
Seems to me this is not intended behavior, which leads me to a (newbie) question: Is there an official bug list I can search/report a bug? Searched msdn but could not find.
TIA,
Mike
-
Mar 26th, 2003, 12:39 PM
#4
Sleep mode
It is probably a bug . that's what I though then . There are a lot of bugs in this version and in the promising version as well that called VS.NET2003 . Let me see if I can find some of them.
-
Mar 26th, 2003, 12:43 PM
#5
Sleep mode
They are increasing day by day , week by week , product by product .
-
Mar 26th, 2003, 12:56 PM
#6
Thread Starter
Frenzied Member
Thanks, Pirate, appreciate your help. Always fun to learn something new and never know if it's my code or not. Keeps me busy anyway........
-
Mar 26th, 2003, 01:00 PM
#7
Sleep mode
No problem dude ! Did you find similar problem on the list ?
-
Mar 26th, 2003, 01:07 PM
#8
Thread Starter
Frenzied Member
No, could not find on either list. The jelovic site has an email link to report a bug, which I'm writing up now.
One might think that Microsoft has an official site for these kind of things, but then again, thinking usually gets me in trouble.
-
Mar 26th, 2003, 07:15 PM
#9
Fanatic Member
okay use the dropdown style
but to ensure only entrys on the list get used place in some auto search code ps maybe also a lil bit of validation
the code i use for the purpose is as follows
VB Code:
Private Sub comboBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cmbProdCat.KeyUp
AutoComplete_KeyUp(comboBox1, e)
End Sub
Public Sub AutoComplete_KeyUp(ByVal cbo As ComboBox, ByVal e As KeyEventArgs)
Dim sTypedText As String
Dim iFoundIndex As Integer
Dim sFoundText As String
Dim sAppendText As String
Select Case e.KeyCode 'allow select keys without auto completing
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete, Keys.Down
Return
End Select
'get the typed text and find it in the list
sTypedText = cbo.Text
iFoundIndex = cbo.FindString(sTypedText)
'if the typed text is found then auto complete
If iFoundIndex >= 0 Then
sFoundText = cbo.Items(iFoundIndex)
sAppendText = sFoundText.Substring(sTypedText.Length)
cbo.Text = sTypedText & sAppendText
cbo.SelectionStart = sTypedText.Length
cbo.SelectionLength = sAppendText.Length
Else
cbo.SelectedIndex = 0
End If
End Sub
-
Mar 27th, 2003, 12:21 PM
#10
Sleep mode
hmm , Is this going to solve dropdown list problem , coz I had similar to that problem too !
-
Jun 28th, 2006, 10:46 AM
#11
New Member
Re: ComboBox and updating data
I experienced a similar error - when I add an item to the combobox's datasource, the display in the collection turns to "AssemblyName.ClassName". Here's how I overcame the bug:
cmbStudyTracks.DataSource = Nothing
cmbStudyTracks.DataSource = _studyTracks
cmbStudyTracks.DisplayMember = "Name"
cmbStudyTracks.ValueMember = "ID"
Works fine now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|