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



ComboBox with a "Not Selected" optionExpand / Collapse
Author
Message
Posted 09/13/2006 5:18:56 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 02/04/2008 8:43:02 AM
Posts: 176, Visits: 1,519
How would you recommend implimenting such a combobox.  I am using the SF combobox and populating that combo with a business object.  I have tried adding a row to the business object (Not Selected) and not saving the data and that seems to work but I just can't find the right setting to get the form to NOT prompt to save if there is changes on the combobox's business object.  My form include settings are all set to DeterminedByBusinessObject and this business object is not directly on the form, it is in a custom user control that is being added to the form, no BOTranslation is being done for this BO. Its include settings are all set to false.  When I look at the forms businessobject coolection in the unsavedchagesexist event I notice that that bo is listed and isdirty is set to true.

Any suggestions?

Post #2807
Posted 09/14/2006 8:35:16 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
I would recommend that rather than adding the extra record to the business object you should use the TopMostItem() option on the ComboBox itself... you can specify both value and a display value for the top most item in the list... generally "<Not Selected>" and 0, or something like that.

Also, if you ever add a record to a business object manually, and you don't want that record to make the business object dirty, then you can accept the changes on the row like this:

MyBO.CurrentRow.AcceptChanges(); //-- Make sure you're on the right row...

This way, you add new rows all day log without the business object thinking it's dirty.


www.bungie.net
Post #2815
Posted 09/14/2006 9:41:31 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: Forum Members
Last Login: 02/04/2008 8:43:02 AM
Posts: 176, Visits: 1,519
Thanks for the info.  I really gotta get my boss to send me to the next class.
Post #2822
Posted 09/14/2006 10:02:12 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
I know it helped several people.


www.bungie.net
Post #2823
« 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 4:45am

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