DateTimePickerAdv On Demand - Defaults
I am using a bound DateTimePickerAdv control. My data entry folks do not want to have to use the mouse to enter a student record. I have fields that need to remain null such as ''Date of Enrollment'' (for a prospect). How can I create a hot key (or other) that would set today as the default date while focused on the respect DateTimePickerAdv? Otherwise - with default text "Not Registered". I don''t want focus to set default else tabbing thru would loose my nulls. Right now the user must open the calendar to pick an initial date.
I noticed there is a keypress event handler but it appears to be useless.
Thanks
I noticed there is a keypress event handler but it appears to be useless.
Thanks
SIGN IN To post a reply.
3 Replies
AR
Anupama Roy
Syncfusion Team
July 31, 2006 06:01 PM UTC
Hi Tom,
Currently it is not possible to create one particular key directly as the hotkey since NullModeKeyReset property that toggles the null state supports only three enums ArrowKeys,NumericKeys and Any .We have already logged a feature report regarding this and soon we will be implementing this feature for DateTimePickerAdv so that one particular key can also be specified as NullModeKeyReset.As a workaround,you can derive a custom class from DateTimePickerAdv and set in such a way that only for that specified keyData,the null date will change to present date.
public class DateTimePickerAdvance:Syncfusion.Windows.Forms.Tools.DateTimePickerAdv
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(this.IsNullDate &&keyData==Keys.Enter )
{
this.Value =System.DateTime.Today ;
}
return false;
}
Please take a look at the sample attached and let us know if you have any difficulties.
Thanks for choosing Syncfusion products.
Regards,
Anu.
Currently it is not possible to create one particular key directly as the hotkey since NullModeKeyReset property that toggles the null state supports only three enums ArrowKeys,NumericKeys and Any .We have already logged a feature report regarding this and soon we will be implementing this feature for DateTimePickerAdv so that one particular key can also be specified as NullModeKeyReset.As a workaround,you can derive a custom class from DateTimePickerAdv and set in such a way that only for that specified keyData,the null date will change to present date.
public class DateTimePickerAdvance:Syncfusion.Windows.Forms.Tools.DateTimePickerAdv
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(this.IsNullDate &&keyData==Keys.Enter )
{
this.Value =System.DateTime.Today ;
}
return false;
}
Please take a look at the sample attached and let us know if you have any difficulties.
Thanks for choosing Syncfusion products.
Regards,
Anu.
DateTime0.zip
TA
Tom Affholter
August 2, 2006 02:41 AM UTC
I am coding VB but I used your idea and it works like a champ! Exactly what I wanted.
Thanks
>Hi Tom,
Currently it is not possible to create one particular key directly as the hotkey since NullModeKeyReset property that toggles the null state supports only three enums ArrowKeys,NumericKeys and Any .We have already logged a feature report regarding this and soon we will be implementing this feature for DateTimePickerAdv so that one particular key can also be specified as NullModeKeyReset.As a workaround,you can derive a custom class from DateTimePickerAdv and set in such a way that only for that specified keyData,the null date will change to present date.
public class DateTimePickerAdvance:Syncfusion.Windows.Forms.Tools.DateTimePickerAdv
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(this.IsNullDate &&keyData==Keys.Enter )
{
this.Value =System.DateTime.Today ;
}
return false;
}
Please take a look at the sample attached and let us know if you have any difficulties.
Thanks for choosing Syncfusion products.
Regards,
Anu.
Thanks
>Hi Tom,
Currently it is not possible to create one particular key directly as the hotkey since NullModeKeyReset property that toggles the null state supports only three enums ArrowKeys,NumericKeys and Any .We have already logged a feature report regarding this and soon we will be implementing this feature for DateTimePickerAdv so that one particular key can also be specified as NullModeKeyReset.As a workaround,you can derive a custom class from DateTimePickerAdv and set in such a way that only for that specified keyData,the null date will change to present date.
public class DateTimePickerAdvance:Syncfusion.Windows.Forms.Tools.DateTimePickerAdv
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(this.IsNullDate &&keyData==Keys.Enter )
{
this.Value =System.DateTime.Today ;
}
return false;
}
Please take a look at the sample attached and let us know if you have any difficulties.
Thanks for choosing Syncfusion products.
Regards,
Anu.
DateTime0.zip
AR
Anupama Roy
Syncfusion Team
August 2, 2006 05:38 PM UTC
Hi Tom,
We are glad to know that you could resolve the issue with this.
Thanks for the update.
Regards,
Anu.
>I am coding VB but I used your idea and it works like a champ! Exactly what I wanted.
Thanks
>Hi Tom,
Currently it is not possible to create one particular key directly as the hotkey since NullModeKeyReset property that toggles the null state supports only three enums ArrowKeys,NumericKeys and Any .We have already logged a feature report regarding this and soon we will be implementing this feature for DateTimePickerAdv so that one particular key can also be specified as NullModeKeyReset.As a workaround,you can derive a custom class from DateTimePickerAdv and set in such a way that only for that specified keyData,the null date will change to present date.
public class DateTimePickerAdvance:Syncfusion.Windows.Forms.Tools.DateTimePickerAdv
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(this.IsNullDate &&keyData==Keys.Enter )
{
this.Value =System.DateTime.Today ;
}
return false;
}
Please take a look at the sample attached and let us know if you have any difficulties.
Thanks for choosing Syncfusion products.
Regards,
Anu.
DateTime0.zip
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
TA Tom Affholter
- Jul 29, 2006 07:21 PM UTC
- Aug 2, 2006 05:38 PM UTC