﻿<?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?)  » Null dates in listview</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 07:25:36 GMT</lastBuildDate><ttl>20</ttl><item><title>Null dates in listview</title><link>http://forum.strataframe.net/FindPost19106.aspx</link><description>Hi,&lt;br&gt;
&lt;br&gt;
More questions about null values... :)&lt;br&gt;
&lt;br&gt;
I use a datepicker to display a date. I have to use the replacement value trick (1800-1-1) in order to save a NULL value when there is no date. No problems here...&lt;br&gt;
&lt;br&gt;
How can I show this field in a listview without showing the value 1800-1-1 to the user? &lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
&lt;br&gt;
Lesscher</description><pubDate>Tue, 09 Sep 2008 09:08:35 GMT</pubDate><dc:creator>Lesscher</dc:creator></item><item><title>RE: Null dates in listview</title><link>http://forum.strataframe.net/FindPost19194.aspx</link><description>[quote][b]William John Tello (09/09/2008)[/b][hr]Out of curiosity, why would you assign the displayvalue property to String.Empty as opposed to ""[/quote] &lt;P&gt;Hi William, &lt;P&gt;It is just for readability of the code, I rather see String.Empty than '' or "", in VFP you could use '', "", [] :P</description><pubDate>Tue, 09 Sep 2008 09:08:35 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Null dates in listview</title><link>http://forum.strataframe.net/FindPost19192.aspx</link><description>Edyhy,&lt;/P&gt;&lt;P&gt;Out of curiosity, why would you assign the displayvalue property to String.Empty as opposed to "" (which is what I would have done and I think a more C# standard way to do it).&amp;nbsp; I'm just curious if there is an advantage to using the Empty static method of the .Net string class?&lt;/P&gt;&lt;P&gt;I'm also assuming there the C# string type must also have a string.Empty() counterpart (which I might have favored because I tend to use the C# types over the .Net types in my own coding).</description><pubDate>Tue, 09 Sep 2008 08:39:41 GMT</pubDate><dc:creator>William John Tello</dc:creator></item><item><title>RE: Null dates in listview</title><link>http://forum.strataframe.net/FindPost19107.aspx</link><description>Hi Lesscher,&lt;P&gt;You can use the ListView.RowPopulating event to handle that situation and many more...&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Private&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; lstItems_RowPopulating(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; lstItems.RowPopulating&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Cast the BO to the type needed.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Using&lt;/FONT&gt;&lt;FONT size=2&gt; bo &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; bizItems = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DirectCast&lt;/FONT&gt;&lt;FONT size=2&gt;(e.BusinessObject, bizItems)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; bo.MyDateTimeField = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Nothing&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;orElse&lt;/FONT&gt;&lt;FONT size=2&gt; bo.MyDateTimeField = #1800-1-1# &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;FONT color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;e.Values(ColumnIndex).DisplayValue = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Using&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;I have not tested the above, but that can give you an idea.</description><pubDate>Fri, 05 Sep 2008 09:28:30 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>