|
-
Jun 16th, 2009, 03:46 PM
#1
Thread Starter
Addicted Member
enter more then 25 hours value
Hi All.
I have DGV like parent form and detail form like child. I want to give ability to user enter time in detail form in format like HHH:mm, save that value in database and display it in DGV.
How to format timepicker or maybe need to use other control to have ability enter time data in format like HHH:mm?
Thanks.
Last edited by eugz; Jun 16th, 2009 at 04:00 PM.
-
Jun 16th, 2009, 04:01 PM
#2
Re: enter more then 25 hours value
Could you explain that a bit more? I think all time is based on the assumption that the earth revolves once in 24 hours. Therefore, I suspect that you may be thinking of something more like a timespan rather than anything that standard time controls would be set up to handle. If that's the case, you will have to come up with a custom solution, for which you should be able to get several suggestions from this forum, but we would need to understand a bit more about what you envision this control doing, and what data it should be capable of capturing.
My usual boring signature: Nothing
 
-
Jun 16th, 2009, 04:19 PM
#3
Thread Starter
Addicted Member
Re: enter more then 25 hours value
What is my target. If employee absence more then 24 hours the user need have ability to enter, for instance, 131:00. And that value I need to display in DGV.
Thanks.
-
Jun 16th, 2009, 05:47 PM
#4
Re: enter more then 25 hours value
Right, that's not a valid time, but it is a timespan. Therefore, I believe you will need to create a control that allows people to enter just what you need. Perhaps a MaskedTextBox might do, with a mask like "000:00". However, that would allow ANY digit to be entered into any of the slots, while you really need the second to the right 0 to max out at 5. There may be a way to do that with a mask, but you might also have to do that with some custom validation.
Having said that, let me also add that I have never been particularly thrilled with the MaskedTextBox for data entry, so you might be better off giving the user two regular textboxes, one for hours and one for minutes.
My usual boring signature: Nothing
 
-
Jun 18th, 2009, 08:44 AM
#5
Thread Starter
Addicted Member
Re: enter more then 25 hours value
Hi All.
Shaggy Hiker, thanks for replay. I'm newer. Can you or somebody show me example how to create user control for my task?
Thanks.
Last edited by eugz; Jun 18th, 2009 at 04:02 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|