Print Page | Close Window

AllowNullDate not working with C#

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=4805
Printed Date: 27 November 2024 at 5:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: AllowNullDate not working with C#
Posted By: Boyd
Subject: AllowNullDate not working with C#
Date Posted: 15 August 2006 at 3:01pm
I've tried various combinations of code to try to get the AllowNullDate feature to work in C#.  No matter what I try, the date is always displayed as "30/12/1899".  The following code sample was added to the C# Property Grid sample project.
 
Below the line:
 
Item = Category.AddChildItem(PropertyItemType.PropertyItemDate, "DateItem", "26/01/2004");
 
I added the following lines:
 
Item = Category.AddChildItem(PropertyItemType.PropertyItemDate, "NullDateItem", null);
((XtremePropertyGrid.PropertyGridItemDate)Item).AllowNullDate("DateIsNull");
 
Does anyone know the trick to getting this to work in C#?
 
Thank you in advance,
 
Boyd



Replies:
Posted By: Boyd
Date Posted: 18 August 2006 at 9:50pm
It appears you have to set the null value after you call the AllowNullDate method.
 
On a side note, you also can't specify an empty string for the AllowNullDate string value to display when it is null.  You must at least specify an empty space.
 
Odd circumstances, but it's now working.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net