Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding to Null Dates
Message
De
09/01/2004 15:26:02
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00865553
Message ID:
00865569
Vues:
31
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform