Jump to content

UniDBGrid EditMask/Editor problem


Recommended Posts

I'm trying to implement a timecard entry screen and I want the grid columns to display in the format hh:mm (easy) and to only allow a time to be entered in edit mode (very difficult).


Getting existing values to display in the hh:mm format simply requires the DataFormat of the field to be set to hh:mm.


However, unlike the VCL DBGrid, the field EditMask property doesn't seem to enforce a date entry. I have tried hh:mm and !9000;1;_ and some other common edit masks but the grid column in the UniDbGrid will accept any input.


As an alternative, I tried to use a UniDateTimePicker as an in-place editor and this does enforce a correct date entry but, the dropdown list shows 01:01, 01:01, 01:01,01:01, 02:01, 02:01, 02:01, etc. instead of 01:00, 01:15, 01:30, 01:45, 02:00, 02:15, etc.


Using a UniDBDateTimePicker and linking that to the underlying field does give a proper dropdown list but, after picking a time from the list and pressing Enter, the grid shows the wrong value, e.g. picking 15:45 from the list results in 15:01 being displayed when Enter is pressed. After the record is posted, the correct time is shown but, it would be very confusing for the user.


Has anybody had any success in implementing edit masks for UniDBGrids?




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...