Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have four combo boxes that are populated from a dataset.

 

When a customer is selected the forms controls are populated with the customers data and the combo boxes are set like this:

 


Me.cboRegion.Text = m_Customer.Region

 

All works OK until I make a change and save the customer detail then this happens;

 

Reselect customer all combo box texts are blank

 

Select another customer some combo box text are blank

 

Select another customer all combo box text are ok

 

Reselct my first customer all combo box text are ok

 

I have checked the m_Customer properties and they have the correct data in them, it just does not seem to display to the combo box text? Well sometimes it does sometimes it doesn't??

My website
Posted

? can't remember that...but all was working fine before I place another combo box on the form.

 

I was able to set the text of the combo box to the customer data, make modifications, save view customer again and all was well??

My website
Posted
Robby, I've done a search for the post you mention above but had no luck :( Can you point me to it cos the more I think about it the more I vaguely remember something about it....I think:)
My website
Posted

Aha so I'm not goin nuts :):)

 

However hope I'm not labouring on a point but this is just weird ;

 

The comboboxes are bound to datasets.

 

On loading the customer data I set the combobox text to match.

 

I can move between different customers and the comboboxes always show the correct customer data.

 

If I modify any control on the form and save the customer then select another customer all controls are displayed correctly except the comboboxes?

 

If I continue to move through the customers the comboboxes eventually start to show the correct data.

 

So are you saying that the Text property is unstable when the combobox is bound to a dataset?

My website
  • Moderators
Posted

It's not unstable, you just are using it incorrectly, there may be some combobox events triggering these unexpected results.

 

Instead, use the SelectedIndex and other methods that utilize the bound values or even the Add method to add new items.

Visit...Bassic Software
Posted

Yeah I've tried doing it another way but always get errors:(

 

Say my combobox has the bound values;

 

LONDON

PARIS

NEW YORK

MADRID

 

And I select a customer whose data includes say NEW YORK. How do I get the combobox to point to the bound data of NEW YORK and display it also?

My website
Posted (edited)

I'm getting nowhere with this problem:(

 

Say I want the combobox to display NEW YORK? I presume I can find this value in the combobox thus;

 


Me.cboLocation.FindStringExact("NEW YORK")

 

but I cannot get it to display the text NEW YORK????

Edited by hog
My website

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...