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
jeff_chingAsked:
Who is Participating?
 
Ariful AmbiaConnect With a Mentor Head of MISCommented:
Hi

add this code

DateTimePicker1.ShowUpDown=True


Hope this will work

Noman
0
 
Ariful AmbiaHead of MISCommented:
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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
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
 
Ariful AmbiaHead of MISCommented:

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
 
jeff_chingAuthor Commented:
Hi Noman,
Thank you very much, it works! ^_^
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.