Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1351
  • Last Modified:

Add a Time only picker control column into DataGridView control in c#

Dear experts,
I would like to know how to create and add a Time only picker control column into DataGridView control in c#

thx
0
jeff_ching
Asked:
jeff_ching
  • 3
  • 3
1 Solution
 
Ariful AmbiaHead of ITCommented:
Hi

Can u use standard DateTimePicker in Gird? If u can do that in the next step just change the "Format" property of the DateTimePicker to "Time". That’s it.

Enjoy

Noman
0
 
bpmurrayCommented:
I think this is what you want - it has source too: http://www.codeproject.com/aspnet/outlooktimefield.asp
0
 
jeff_chingAuthor Commented:
Dear all experts,
Thx for the comments.

Let me state the details:
1. I am working on a window form project not asp.net
2. I need the column in datagridview control
3. The column should get some kinds of UI to let use select or input the time value rather than just display the time value.

By the way, I had tried to create a user control and add into the datagridview control but the event handling is too hard for me.

thx
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Ariful AmbiaHead of ITCommented:

Dear Jeff_ching

u don't need to create new user control. follow my instruction I believe u will get result.

Noman
0
 
jeff_chingAuthor Commented:
Dear Noman,
I do try your method, but it only display the time values only. When I clicking the contro's drop down button it only show a calendar which still cannot allow me to select time value. May be I mis-set the control's attributes. Can you show me the way?

thx
0
 
Ariful AmbiaHead of ITCommented:
Hi

add this code

DateTimePicker1.ShowUpDown=True


Hope this will work

Noman
0
 
jeff_chingAuthor Commented:
Hi Noman,
Thank you very much, it works! ^_^
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now