We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DateTimePickeeExt doesnot takes value from keyboard

Hi, I am presently facing a problem with the DateTimePickerExt. I have used this control in my form and have set its NullString and IsNullDate property. Now when I press any numeric key the control shows the current datetime. My problem is when the user presses a numeric key that number should be reflected. Is that possible? Do suggest me something regarding this issue.

6 Replies

AD Administrator Syncfusion Team November 8, 2004 09:48 AM UTC

Hi Kalyan, Sorry for the delay in responding. Currently there is no way to make the DataTimePicker select the date corresponding to the numeric key pressed. This behavior would require making changes to the library. I have already requested the development team to make the necessary changes and will update this thread when this feature is implemented.Sorry for the inconvenience. Thanks. Best regards, Stephen. >Hi, > I am presently facing a problem with the DateTimePickerExt. I have used this control in my form and have set its NullString and IsNullDate property. Now when I press any numeric key the control shows the current datetime. My problem is when the user presses a numeric key that number should be reflected. Is that possible? > Do suggest me something regarding this issue. >


JB Jurgen Beck December 6, 2004 10:19 PM UTC

I think that''s one of the weakest aspects about the DateTimePickerAdv control! Almost makes it useless for applications where the user wants to enter the date manually via keyboard and does not want to pick it all the time from the Calendar... Jurgen


AD Administrator Syncfusion Team December 10, 2004 06:43 PM UTC

Hi Jurgen, Cuurrently it is possible to key in dates using numeric keys in the DateTimePicker. You would need to set the TabForwarding property to true so that the user can use the Tab key to navigate to the different fields. Could you please let us know the specific behavior you would like to be implemened in the DateTimePicker. We will definitely try to implement them at the earliest. Sorry for the inconvenience. Thanks. Best regards, Stephen. >I think that''s one of the weakest aspects about the DateTimePickerAdv control! Almost makes it useless for applications where the user wants to enter the date manually via keyboard and does not want to pick it all the time from the Calendar... > >Jurgen


AD Administrator Syncfusion Team July 18, 2005 07:50 PM UTC

Hi Stephen I would also like to know how to enable the keyboard entering of data into a datetimecell. Attached is the sample project code I am using for Datetimecell, let me know what changes I need to make. Thanks Srividya VirtualGrid_DateTime_5379.zip


AD Administrator Syncfusion Team July 19, 2005 03:02 PM UTC

In a virtual grid, you have to handle SaveCellInfo to push modified data back into your data source.
private void MyGrid_SaveCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs e)
{
	if(e.RowIndex > 0 && e.ColIndex > 0)
	{
		this.SetCellValue(e.RowIndex-1, e.ColIndex, e.Style.FormattedText);
	}
    e.Handled = true;
}

private void SetCellValue(int row, int col, object val)
{
	RecordStruct empStruct = m_InfoList[row] as RecordStruct;
	switch(col)
	{
		case 1: 
				empStruct.EmployeeName = val.ToString();
			break;
		case 2: 
			empStruct.EmployeeNum = val.ToString();
			break;
		case 3: 
			empStruct.JoiningDate = val.ToString();
			break;
		default:
			break;
	}
}


DF David Fernández February 5, 2008 04:19 PM UTC

//This works fine for me
private void DateTimePicker_PreviewKeyDown(object sender, System.Windows.Forms.PreviewKeyDownEventArgs e)
{

if (DateTimePicker.IsNullDate)
{
DateTimePicker.IsNullDate = false;
}
//Now you can enter digits again
}


Loader.
Live Chat Icon For mobile
Up arrow icon