Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 18:34

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 11 Mar 2014, 14:55 
Offline

Joined: 10 Mar 2014, 15:42
Posts: 14
Hi,

I have the following strange issue with all datetime fields in my dbgrideh.
When I enter any time value (like 11:23, or 19:23) and I exit that column, the value is fine
But when I come back to that column (i.e. that column gets the focus), the value changes itself to 18:23!

The minute part remains correct (i.e. thus I entered), but the hour part becomes always 18, whatever the original value was!
The dataset is empty and cachedupdate it set tu true.
I only have problem with the time datatype.
Also, when I change the datatype of that field to string in the memtable component, the grid doeasnot seems to take it into account as it complans that 99:99 is not a datetime value.

What is the problem here???

Environment:
ehlib 6.3.168
components used:
dbgrideh,
memtableeh
datasetdrivereh
adoquery


Top
 Profile  
 
PostPosted: 13 Mar 2014, 14:30 
Offline
Администратор

Joined: 22 Dec 2011, 20:19
Posts: 335
Hello

To understand the reason of this problem we need to reproduce same error on our computer.
Can you create and send us Demo project that shows it?

Best regards
Admin

_________________
Best regards
Admin


Top
 Profile  
 
PostPosted: 13 Mar 2014, 15:28 
Offline

Joined: 10 Mar 2014, 15:42
Posts: 14
Hi,

Attached the demo project.
You can enter whatever time you want (for example 12:34), once you leave the time field the value seems to be fine, but when you select it again the hour part of the time will become 18.


Attachments:
eh_time_demo.zip [8.44 KiB]
Downloaded 211 times
Top
 Profile  
 
PostPosted: 14 Mar 2014, 10:35 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hi,

EditMask for time fields isn't 00:00, but !90:00:00;1;0

Rico


Top
 Profile  
 
PostPosted: 14 Mar 2014, 17:11 
Offline

Joined: 10 Mar 2014, 15:42
Posts: 14
Rico,

Quote:
EditMask for time fields isn't 00:00, but !90:00:00;1;0


It doesn't solve my problem.
First of all I do not want to enter the second part of the time
And if I use the editmask without the second part, like !90:00;1;0 in this case when I'm coming back to that field (time is getting the focus) the hour part is now fine, but tie minute part is change to 00!!! So my value of 11:23 is changes to 11:00!!!

Or
If I'm leaving the editmask as You've indicated AND keeping the displaymask as HH:NN, I'll get a runtime error message saying 11:23: is not a valid date and time.

So my question is simple: How can I enter just a time without seconds (HH:NN)?


Top
 Profile  
 
PostPosted: 14 Mar 2014, 23:00 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hi boumboum,

See my demo to do what you need
I use onSetText and onGetText events


Attachments:
eh_time_HHMM.zip [13.24 KiB]
Downloaded 229 times
Top
 Profile  
 
PostPosted: 15 Mar 2014, 07:59 
Offline

Joined: 10 Mar 2014, 15:42
Posts: 14
Hi rico,

It's kind a working but if before entering any text you click an the dropdown button, you will have an error message saying " : is not a valid date and time". So the gettext/settext is not working thare.
Of course there is a way to set the ButtonStyle to cbsNone but in this case you will not have the possibility to define a dropdown form.

Anyway, thanks for the solution. It's not quite straightforward nor really out of the box but this is a workaround. :-)


Top
 Profile  
 
PostPosted: 15 Mar 2014, 11:13 
Offline

Joined: 09 Feb 2012, 17:05
Posts: 124
Hi boumboum,

I don't use the new feature dropDownForm yet, but strange that you can't define it...
In this case add an edit button and create your own form (don't use dropDownButton style).

PS : I had the same problem, look at this : viewtopic.php?f=5&t=144

Rico


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 74 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group