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.
Unfortunately, activation email could not send to your email. Please try again.

Regarding Datetimepicker

Thread ID:

Created:

Updated:

Platform:

Replies:

42369 Mar 28,2006 12:42 AM Mar 29,2006 04:27 PM Windows Forms 2
loading
Tags: Tools
Sathish Basakran
Asked On March 28, 2006 12:42 AM

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 09:16 AM

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 04:27 PM

Hey Thanks Anu, much appreciated. Sathish

CONFIRMATION

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.

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.

;