﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Combo TopMostValue and Nulls</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 10:00:55 GMT</lastBuildDate><ttl>20</ttl><item><title>Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20554.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I have a combobox with a lookup list bound to an int field. For the int field,&amp;nbsp;my BO returns 0 as an alternate for null and my TopMostValue is set to 0. I have read several posts on here which suggests that if I select the TopMostItem then it should write Null back to the database and not 0. In my case, it writes 0 back to the database.&lt;/P&gt;&lt;P&gt;My database can accepts nulls so there is no problem on that score. Given the other posts, should I be seeing Null or 0 written to the database?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Aaron</description><pubDate>Thu, 06 Nov 2008 08:41:10 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20587.aspx</link><description>That's just it Greg, I didn't figure it out - you did! :)</description><pubDate>Thu, 06 Nov 2008 08:41:10 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20584.aspx</link><description>Anytime. Glad you got it figured out! :D</description><pubDate>Thu, 06 Nov 2008 08:08:01 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20575.aspx</link><description>Yeah, Greg is on fire :)&lt;/P&gt;&lt;P&gt;I had the wrong setting in the BO - I was just returning an alternate value rather than setting it too.&lt;/P&gt;&lt;P&gt;Thanks Greg</description><pubDate>Thu, 06 Nov 2008 03:39:59 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20565.aspx</link><description>Yup, Greg is on fire today :D</description><pubDate>Wed, 05 Nov 2008 11:29:31 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20564.aspx</link><description>I do this all the time (have a field that accepts NULL and is using a combo). First, you setup the BO to set/return an alternate value for NULL. Note there are four possibilities for handling NULLs at the BO level: don't allow them, use a nullable type, return an alternate value in the BO if the db has a NULL, and both return an alternate value if the db is NULL and set NULL in db if the BO contains the alternate value.  You want that last one. Sounds like you may have done this and are using zero. A good choice if valid values are positive integers.  Next, you setup you combo to have a top most value. The value itself is zero, as that actually means NULL.  Setup the topmosttext to be either a space or some text indicating that no value is selected.  When the user selects the top most value, the property in the BO gets a zero, which translates into a NULL when saved to the database. :D</description><pubDate>Wed, 05 Nov 2008 11:04:31 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20559.aspx</link><description>Heh, I was afraid you would ask that :w00t:.&amp;nbsp; In short, no, the topmostitem isn't really designed to work with Null values. &lt;/P&gt;&lt;P&gt;If you have that need, you'll need to populate the combo manually, creating your own datasource for the combobox with a null top most item. :)&amp;nbsp;</description><pubDate>Wed, 05 Nov 2008 10:05:11 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20556.aspx</link><description>Thanks for the reply Dustin. Is it possibly to specify a null value for TopMostValue instead of 0? I tried Null but it throws an error.&lt;/P&gt;&lt;P&gt;Thanks.</description><pubDate>Wed, 05 Nov 2008 09:24:10 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Combo TopMostValue and Nulls</title><link>http://forum.strataframe.net/FindPost20555.aspx</link><description>You should be seeing the 0, so it is working as designed. It will return whatever value you specify as the TopMostValue. :)</description><pubDate>Wed, 05 Nov 2008 09:13:19 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item></channel></rss>