StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



BO form with a drop down list to pick a...Expand / Collapse
Author
Message
Posted 09/18/2007 3:33:37 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 01/05/2008 4:28:48 AM
Posts: 16, Visits: 177
I cannot get my WinForms app to work correctly with my related business objects.

I have the following object model:

  • BOMain links to exactly 1 BOLookup so it has a FK to BOLookup. i.e. BOMain.FK_Lookup

I have a maintenance form to maintain BOMain objects. The form has a drop-down list to choose a BOLookup to link the BOMain instance to.

The problem I'm having is with the BOLookup drop-down list. I cannot get any items to appear in the drop down list. I can confirm the following:

  • The database is populated correctly
  • I have a BO for BOLookup
  • I have a BO for BOMain
  • I have created a .ParentRelationship on BOMain to wire up to BOLookup
  • My form has a BOMain "object" (named BOMainInstance for this example)
  • My form has the .PrimaryBusinessObject = BOMainInstance
  • My form has a SF combo control with the following settings: .BindingField = FK_Lookup, .BusinessObject = BOMain, .PopulationDataSource = BOLookup.FillAll(), .PopulationType = BusinessObject
  • My form does NOT have a BOLookup "object" as I believe the combo control will create its own instance behind the scenes
  • All other data maintenance functionality on the form is working correctly

I'm expecting the drop down to sync with the correct linked object for existing records and allow the user to choose an alternate linked item to link to

When I run the app, the drop down list on the form is always empty. When the drop down is expanded, it shows a number of "blank" rows (which is the same number of rows as there are in the Lookup table so I'm assuming the relationship is "working" but the UI isn't set up correctly)

Any ideas what I've missed?

Post #11556
Posted 09/19/2007 8:58:44 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
When you set the PopulationDataSourceSettings, did you specify the fields to display within the combo box?  You will need to add the fields to display to the list and each will be assigned an index.  Once they are assigned indexes ({0}, {1}, {2}...{n}), you will need to set the display value.  The display value will be a String.Format expression that contains replacement values for the fields you chose to display.  So, if you choose, say, Name and Description as your two fields and Name as assigned {0} and Description was assigned {1}, then your display value will need to be "{0} - {1}"  If you leave the Display Value blank, the combo box will literally display a blank value for each of the items within it.

Other than that, everything you've done is correct.  Just make sure you have the lookup pk value set as the Value within the PopulationDataSourceSettings.


www.bungie.net
Post #11571
Posted 09/19/2007 2:07:59 PM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 01/05/2008 4:28:48 AM
Posts: 16, Visits: 177
Thanks Ben - spot on
Post #11603
Posted 09/20/2007 8:55:56 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
No problem.  I also forgot to mention that since it's a String.Format replacement string, you can put formatting values after a : in the replacement tag.  So, if you have a value of 1200

{0} will print 1200

{0:C} will print $1,200

{0:N2} will print 1,200.00

Just FYI.  And you can get a full list of the format strings through the .NET documentation by searching for format strings.  There are tons of them for dates, too ({0:MM/dd/yyyy}).


www.bungie.net
Post #11614
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 3:53am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.