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



Listbox valueMemberExpand / Collapse
Author
Message
Posted 03/08/2006 1:49:39 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 05/25/2007 3:34:57 PM
Posts: 235, Visits: 309
I am trying to use your listbox. I have set the PopulationType to BusinessObject and set the PopulationDataSourceSettings including specifying the ValueMember. This does not fill in the valuemember property of the control and if try to set that directly the popup menu only offers none. upon Execution I get:

InvalidOperationException
Cannot set the SelectedValue in a ListControl with an empty ValueMember.

Source : System

Could you please straighten me out on this?
Post #604
Posted 03/08/2006 2:18:21 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 08/01/2008 8:53:41 AM
Posts: 2,671, Visits: 1,879
Within the population data source settings, set the Value Member to whatever field you want to use as the selected value. Then, in the property sheet for the ListControl, right-click the ValueMember property name and select "Reset" from the context menu. When the list is populated at runtime, the ValueMember property will be dynamically set to the name of the dynamically created DataTable that is used as the list source.

Also, make sure the "Value Member" within the PopulationDataSourceSettings dialog is set to the name of a valid field on the business object.

If resetting the ValueMember property doesn't work, then make sure you're not setting the ValueMember anywhere in code. If that still does not work, post some screenshots of your configurations, and maybe I can make something of it.


www.bungie.net
Post #605
Posted 03/08/2006 3:49:32 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 05/25/2007 3:34:57 PM
Posts: 235, Visits: 309
I have attached a screen-shot.

The reset option is grayed-out on ValueMember.

I am also unclear about needing to set the BusinessObject property and the DataSource property. It seems like setting the businessObject would be sufficient. In any case I have tried it with and without the datasource being set and the control comes up empty.

I am populating a c1TrueDataGrid simultaneously from the same BO as a test and it displays data.

  Post Attachments 
ListBox.jpg (48 views, 99.14 KB)
Post #607
Posted 03/10/2006 5:44:31 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
Daniel,

Could you please email the picture.  It was shurnk when added and there fore unreadable  Thanks.

Post #614
Posted 03/10/2006 7:10:57 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 05/25/2007 3:34:57 PM
Posts: 235, Visits: 309
I can't upload anything. It says that I have used 480 of 512 kb.
Post #617
Posted 03/13/2006 12:42:51 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
There is more than one way to populate a list using a business object. The manual method which would entail you use the DataSource, DisplayMember, and ValueMember properties.  The other is to set the PopulationType to BusinessObject and set the PopulationDataSourceSettings property.  For an exmaple or a reference on how to do this, refer to this thread on the forum: http://forum.strataframe.net/Topic596-6-1.aspx .  If this doesn't help let me know.
Post #626
Posted 03/13/2006 1:12:58 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 05/25/2007 3:34:57 PM
Posts: 235, Visits: 309
How would I set the DataSource, DisplayMember, and ValueMember properties?
Post #629
Posted 03/13/2006 2:57:00 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
All listboxes have a DataSource, ValueMember, and DisplayMember as does a combo box.  To use those properties add something like this:

MyListBox.DisplayMember = "MyDisplayFieldName"
MyListBox.ValueMember = "MyValueFieldName - Usually a PK of some sort"
MyListBox.DataSource = MyBusinessObject.CurrentDataTable

That's it

Post #634
« 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 12:58am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.062. 12 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.