To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Article :: Building Dynamic Systems with Expressions in .NET
How Is XML Like An Interface?
Understanding Covariance and Contravariance
Print VS 2010 Keyboard Shortcut References in Letter (8.5x11in) and A4 (210×297mm) Sizes
Updated Productivity Power Tools



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Display Modes
Old Mar 26th, 2003, 09:40 AM   #1
Mike Hildner
Frenzied Member
 
Mike Hildner's Avatar
 
Join Date: Jul 02
Location: Des Moines, NM
Posts: 1,690
Mike Hildner will become famous soon enough (65+)
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
Mike Hildner is offline   Reply With Quote
Old Mar 26th, 2003, 10:30 AM   #2
Pirate
Elite Member ®
 
Join Date: Aug 02
Location: RUH
Posts: 8,063
Pirate has a spectacular aura about (125+)Pirate has a spectacular aura about (125+)
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 !
__________________
Pirate is offline   Reply With Quote
Old Mar 26th, 2003, 11:32 AM   #3
Mike Hildner
Frenzied Member
 
Mike Hildner's Avatar
 
Join Date: Jul 02
Location: Des Moines, NM
Posts: 1,690
Mike Hildner will become famous soon enough (65+)
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
Mike Hildner is offline   Reply With Quote
Old Mar 26th, 2003, 11:39 AM   #4
Pirate
Elite Member ®
 
Join Date: Aug 02
Location: RUH
Posts: 8,063
Pirate has a spectacular aura about (125+)Pirate has a spectacular aura about (125+)
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.
__________________
Pirate is offline   Reply With Quote
Old Mar 26th, 2003, 11:43 AM   #5
Pirate
Elite Member ®
 
Join Date: Aug 02
Location: RUH
Posts: 8,063
Pirate has a spectacular aura about (125+)Pirate has a spectacular aura about (125+)


They are increasing day by day , week by week , product by product .
Pirate is offline   Reply With Quote
Old Mar 26th, 2003, 11:56 AM   #6
Mike Hildner
Frenzied Member
 
Mike Hildner's Avatar
 
Join Date: Jul 02
Location: Des Moines, NM
Posts: 1,690
Mike Hildner will become famous soon enough (65+)
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........
Mike Hildner is offline   Reply With Quote
Old Mar 26th, 2003, 12:00 PM   #7
Pirate
Elite Member ®
 
Join Date: Aug 02
Location: RUH
Posts: 8,063
Pirate has a spectacular aura about (125+)Pirate has a spectacular aura about (125+)
No problem dude ! Did you find similar problem on the list ?
__________________
Pirate is offline   Reply With Quote
Old Mar 26th, 2003, 12:07 PM   #8
Mike Hildner
Frenzied Member
 
Mike Hildner's Avatar
 
Join Date: Jul 02
Location: Des Moines, NM
Posts: 1,690
Mike Hildner will become famous soon enough (65+)
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.
Mike Hildner is offline   Reply With Quote
Old Mar 26th, 2003, 06:15 PM   #9
rudvs2
Fanatic Member
 
rudvs2's Avatar
 
Join Date: Mar 01
Location: NZ
Posts: 935
rudvs2 is an unknown quantity at this point (<10)
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:
  1. Private Sub comboBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cmbProdCat.KeyUp
  2.         AutoComplete_KeyUp(comboBox1, e)
  3. End Sub
  4. Public Sub AutoComplete_KeyUp(ByVal cbo As ComboBox, ByVal e As KeyEventArgs)
  5.         Dim sTypedText As String
  6.         Dim iFoundIndex As Integer
  7.         Dim sFoundText As String
  8.         Dim sAppendText As String
  9.         Select Case e.KeyCode 'allow select keys without auto completing
  10.             Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete, Keys.Down
  11.                 Return
  12.         End Select
  13.         'get the typed text and find it in the list
  14.         sTypedText = cbo.Text
  15.         iFoundIndex = cbo.FindString(sTypedText)
  16.         'if the typed text is found then auto complete
  17.         If iFoundIndex >= 0 Then
  18.             sFoundText = cbo.Items(iFoundIndex)
  19.             sAppendText = sFoundText.Substring(sTypedText.Length)
  20.             cbo.Text = sTypedText & sAppendText
  21.             cbo.SelectionStart = sTypedText.Length
  22.             cbo.SelectionLength = sAppendText.Length
  23.         Else
  24.             cbo.SelectedIndex = 0
  25.         End If
  26. End Sub
rudvs2 is offline   Reply With Quote
Old Mar 27th, 2003, 11:21 AM   #10
Pirate
Elite Member ®
 
Join Date: Aug 02
Location: RUH
Posts: 8,063
Pirate has a spectacular aura about (125+)Pirate has a spectacular aura about (125+)
hmm , Is this going to solve dropdown list problem , coz I had similar to that problem too !
Pirate is offline   Reply With Quote
Old Jun 28th, 2006, 10:46 AM   #11
josh.kodroff
New Member
 
Join Date: Jun 06
Posts: 1
josh.kodroff is an unknown quantity at this point (<10)
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.
josh.kodroff is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:55 PM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.