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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Regarding Datetimepicker

Thread ID:





42369 Mar 28,2006 05:42 AM UTC Mar 29,2006 09:27 PM UTC WinForms 2
Tags: Tools
Sathish Basakran
Asked On March 28, 2006 05:42 AM UTC

Hi Consider there are Two Datetimepicker, which is Namely Opendate and Closedate. Steps are : In ''opendate'' Datetimepicker , there is the defualt Setting value(Eg : 01/02/2002 : 13:55:30(dd/mm/yyyy)). My question is I want to change (only)Year in the "Opendate" using keyborad(Arrow Keys), after edit the year, i want to press the "Closedate" or next i want to focus the Closedate field by pressing mouse key. Actual Result: I could not get the new edited year value Excepted Result: Year should change,, Note : After change the Year , directly move the cursor into next field "Closedate", Dont try by mouse selection These are the codes: private void dtpOpeningDate_Validating(object sender, CancelEventArgs e) { if (!mStockpile.CloseDate.IsNull && dtpOpeningDate.Value.Value >= mStockpile.CloseDate.Value) { dtpOpeningDate.Value = mStockpile.OpenDate; MessageBox.Show(mInvalidOpeningDateMsg, Application.ProductName, MessageBoxButtons.OK ,MessageBoxIcon.Information); e.Cancel = true; } } private void dtpOpeningDate_Validated(object sender, EventArgs e) { mStockpile.OpenDate = dtpOpeningDate.Value.Value; }

Anupama Roy [Syncfusion]
Replied On March 29, 2006 02:16 PM UTC

Hi Sathish, I checked with the following code with the given conditions and this works for me. private void dtpOpeningDate_Validated(object sender, System.EventArgs e) { this.CloseDate.Value =this.dtpOpeningDate.Value ; } private void dtpOpeningDate_Validating(object sender, CancelEventArgs e) { if ( dtpOpeningDate.Value>= this.CloseDate.Value) { this.CloseDate.Value =this.dtpOpeningDate.Value ; e.Cancel = true; } } Have you used syncfusion DateTimePickerAdv control itself? I could see dtpOpeningDate.Value.Value in your coding which seems to be wrong. Please let me know if you need furthur assistance. Thanks, Anu.

Sathish Basakran
Replied On March 29, 2006 09:27 PM UTC

Hey Thanks Anu, much appreciated. Sathish


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon