public class NullableDateTimePicker : System.Windows.Forms.DateTimePicker
{
// Default Constructor
public NullableDateTimePicker() : base()
{
base.Format = DateTimePickerFormat.Custom;
NullValue = " ";
Format = DateTimePickerFormat.Custom;
CustomFormat = "dd MMM yyyy";
this.DataBindings.CollectionChanged += new CollectionChangeEventHandler(DataBindings_CollectionChanged);
}
}
//NullableDateTimePicker is the class from which DateTimePickerEditingControl class inherits.
//IDataGridViewEditingControl is the interface which DateTimePickerEditingControl class implements.
class DateTimePickerEditingControl : NullableDateTimePicker, IDataGridViewEditingControl
{
//Constructor
public DateTimePickerEditingControl()
{
this.Format = DateTimePickerFormat.Custom;
this.CustomFormat = "dd MMM yyyy";
}
}
1 answers
It's difficult to translate snippets like this, particularly when they appear to be incomplete but, for the first one, try this:
and for the second one:
EDIT - changed comments to use old Rem keyword in hope it will format better on this site
answered one year ago by:
17279