Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding to Null Dates
Message
From
09/01/2004 15:26:02
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00865553
Message ID:
00865569
Views:
32
Clay,

I had the same question a couple weeks ago, and Kevin was kind enough to post the following reply. This works fine. We ended up using Component One's datepicker control instead, because there was more options for the styles and the dropdown calendar. The only hang-up we had then was getting the C1 datepicker to work with MM's data binding...

-Nate
---------------------------

You can override the DatePicker's Value property like this:
public new object Value
{
	get { return base.Value; }
	set 
	{
		if (value is DateTime)
		{
			base.Value = (DateTime)value;
			this.Checked = true;
		}
		else if (value == DBNull.Value)
		{
			this.Checked = false;
		}
		else
		{
			throw new ArgumentException(
				"Argument must be a DateTime or DBNull.Value");
		}
	}
}
I'll be adding this to the mmDatePicker class, but in the interim you can add this to your subclass of mmDatePicker.

Regards,
Kevin McNeish
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform