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.
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.
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.
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.
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.