|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
What language and platform is this for?
|
|
#3
|
|||
|
|||
|
Sorry, I forgot to mention this: The language is C# on Microsoft Visual Studio .NET
|
|
#4
|
|||
|
|||
|
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! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > DateTimePicker problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|