DateTimePicker Control Displays current date by default at design and runtime. How is it possible to show the blank or empty in the control atleastat runtime.
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hi himanshu,
You can set the Format property of DateTimePicker control to "Custom" and set value of CustomFormat as blank.
And at runtime you can set CustomFormat value on ValueChange event of the control.
dtp_ValueChanged(....)
{
dtp.CustomFormat="dd/MM/yyyy";
}
Kirtan PatelPosted Oct 5, 2009, 9:22 PM
DateTime Picker Control Can not have Blank Value as Default
Some date Must Be Selected when Loading Control ...
you can Also Specify Some other date instead of default one but you have to select ..it cant be blank :)
dont forget to mark "do you like this answer" if answer helped you :)
roy himanshuPosted Oct 5, 2009, 9:14 AM
naura paxPosted Oct 5, 2009, 6:33 AM
roy himanshuPosted Oct 5, 2009, 6:19 AM
thanx for ur response,but still it shows default current date when form is load.
naura paxPosted Oct 5, 2009, 5:48 AM
You can set the Format property of DateTimePicker control to "Custom" and set value of CustomFormat as blank.
And at runtime you can set CustomFormat value on ValueChange event of the control.
dtp_ValueChanged(....)
{
dtp.CustomFormat="dd/MM/yyyy";
}