My combobox does not display the information in the BO


Author
Message
Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
This one is really driving me crazy ( a short drive for me ).

I have a combo box that displays all the US states - it displays the full state name and the value member is the postal abbreviation. I can see the data in the table in SQl Server and in th BO when I step through the code. But the state does not display in the combo unless I edit the record in the UI and save it. What is up with this?

Thanks

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Marcia.

Is the Postal Abbreviation the PK for the State's table?

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you do not have a record loaded and the control is bound, the PK or code may not have a value, so in this instance, the combo will appear as blank.  If you remove the binding (just for a test) then you will probably see your code.  This is a good place to use a top most value if you don't have a record loaded or a value that appears in the combo, you can have a top most value to show something at least.  This is just a guess, but I bet it is what you are fighting.
Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Ivan George Borges (11/24/2008)

Is the Postal Abbreviation the PK for the State's table?

Hi Ivan.

Actually, it is not a states table Smile I have a pair of tables called lookup_hdr that contains all the categories for the various lookups used in the app and lookup_det that contains all the lookup detail items for each category. No, the state abbreviation is not the PK in lookup_det - I never use keys that contain business information.

The odd thing is that I have combos set up in exactly the same way in other forms in the application and it works just fine in the other forms Sad This one had a bug in it earlier - the combo was set up incorrectly and was using the PK as the value member but the field in the table it was trying to update was a VARCHAR. I wonder if this has something to do with it, but if it does, I have absolutely no idea of how to fix it.

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (11/24/2008)
If you do not have a record loaded and the control is bound, the PK or code may not have a value, so in this instance, the combo will appear as blank.  If you remove the binding (just for a test) then you will probably see your code.  This is a good place to use a top most value if you don't have a record loaded or a value that appears in the combo, you can have a top most value to show something at least.  This is just a guess, but I bet it is what you are fighting.

Hi Trent.

No - this is not it. As I navigate through the records, the combo appears blank but the property in the BO has the correct value. Please see my response to Ivan if it will help you to guide me through this stupid problem Smile

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, it could be a couple of things.  You may want to change the BindingProperty to Text instead of SelectedValue (depending on how you are binding and have the combo setup).  Another option would be that the ValueMember property is not set to the appropriate field (which from what you are saying you have already checked).

Also, my response may change a bit if you are manually setting the DataSource, DisplayMember, and ValueMember or the SF population settings.

One other thing to check, if you are using the SF population, then be sure that the DisplayMember in the PopulationDataSourceSettings is set to a value and not empty...that can produce an empty combo as well (i.e. {0}, {1}, etc.)

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (11/24/2008)
Well, it could be a couple of things.  You may want to change the BindingProperty to Text instead of SelectedValue (depending on how you are binding and have the combo setup).  Another option would be that the ValueMember property is not set to the appropriate field (which from what you are saying you have already checked).

Also, my response may change a bit if you are manually setting the DataSource, DisplayMember, and ValueMember or the SF population settings.

One other thing to check, if you are using the SF population, then be sure that the DisplayMember in the PopulationDataSourceSettings is set to a value and not empty...that can produce an empty combo as well (i.e. {0}, {1}, etc.)

The thing that is really goofy is that I have combos set up exactly the same way in other forms and they work just fine. I even added this line of code in the boParticipant_Navidated event handler:

cbostate_nme.SelectedValue = boParticipants.state_nme;

and even when boParticipants.state_nme contained the value "OH", after the line of code executed, cbostate_nme.SelectedValue was still null and nulls are not allowed in this field! So what is up with this?

The combo is set up to use populate using a BO and the display fields and so on all look just like they do in the forms where this is working.


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is there any way that you could slap this on a sample form and let me take a look?
Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (11/24/2008)
Is there any way that you could slap this on a sample form and let me take a look?

I have been trying to tell you how I solved this but I keep getting this error when I try to post the response:

The board administrator has requested that you must provide some message content within your post. You cannot post only HTML, Images, EmotIcons or IFCode.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You are probably cutting the code from one place and the pasting it.  It you paste it into notepad or something to strip the formatting first you will more than likely not see this message.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search