General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 7th, 2003, 05:12 AM
bogdip bogdip is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Romania
Posts: 5 bogdip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question DateTimePicker problem

I have a problem with a DTPicker in my WindowsForm.
The DTPicker is CheckBoxed (ShowCheckBox = true) and is bound to a data source (a data(as string) colum in a table).

In the format event of the DTPicker's Binding object, I have to check the column value and if it's a null string I want to set the DTPicker to the current date and uncheck it. But it does not want to uncheck itself. It remains checked.

Implicitly the DTPicker is unchecked but when i set it's value to the current date it check itself automaticaly.

Here is my portion of code :

private void StringToDate(object sender, ConvertEventArgs cevent) {
string date = (string)cevent.Value;
if (date==" - -") {
cevent.Value=DateTime.Now;
dtp_datalimita.Checked=false;
return;
}
......
}

The "checked" property of "dtp_datalimita" is set on false but the DTPicker is shown as checked.
I tryed "dtp_datalimita.Refresh" after "dtp_datalimita.Checked=false;" but it does not work.

Did enyoane encounter a similar problem ?
Is this a bug?
Is there a solution to my problem?

Thanks to all that will find enough time to look on to this piece of paper !

My address

Reply With Quote
  #2  
Old August 7th, 2003, 06:54 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
What language and platform is this for?

Reply With Quote
  #3  
Old August 8th, 2003, 03:09 AM
bogdip bogdip is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Romania
Posts: 5 bogdip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry, I forgot to mention this: The language is C# on Microsoft Visual Studio .NET

Reply With Quote
  #4  
Old September 24th, 2003, 04:59 AM
Kalle Kalle is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 Kalle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I had the same problem

I did find a strange sollution to this and it is very easy.

dtp.Checked = false;

does not work.

dtp.Checked = true;
dtp.Checked = false;

Seems to work fine!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > DateTimePicker problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT