Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.5 DataGrid
I want to display both time and date in datagridview column .at the same time it should be editable also.I tried with the code provided in MSDN link. but it shows the date only. it shows time as 12:00 and it is not editable too. the code which i used is given below
 
http://msdn.microsoft.com/en-us/library/7tas5c80.aspx[^]
 
but this code i am able to retrieve only date information
Posted 4-Oct-11 3:28am
Edited 4-Oct-11 3:32am
v2
Comments
Mark Nischalke at 4-Oct-11 8:32am
   
Long block of unformatted code removed and replaced with link to MSDN page where it was copied from.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please set the format to your column to yyyy/MM/dd HH:mm
  Permalink  
Comments
MohammadIqbal at 4-Oct-11 8:47am
   
but when i click on any cell in this column a dropdown calendar appears which make me to edit only date information . i wnt to edit time too. what should i adjust to edit the time please help somebdy
chemnoor at 5-Oct-11 1:43am
   
dot your datepicker to edit the time and date just use simple textbox
Mark Nischalke at 5-Oct-11 7:54am
   
And what if the UI design called for a calendar? What about validation? Not a very good suggestion.
MohammadIqbal at 4-Oct-11 8:52am
   
when the cell is not clicked it shows time (some default time). but when it is clicked a calendar is appears which do not have any provision to update time
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
MohammadIqbal at 4-Oct-11 9:03am
   
but when i click on any cell in this column a dropdown calendar appears which make me to edit only date information . i wnt to edit time too. what should i adjust to edit the time please help somebdy
MohammadIqbal at 4-Oct-11 9:03am
   
when the cell is not clicked it shows time (some default time). but when it is clicked a calendar is appears which do not have any provision to update time
Mark Nischalke at 4-Oct-11 12:00pm
   
Yes, the default calendar control does not have Time. You need to use a third-party control or make two fields
MohammadIqbal at 4-Oct-11 9:04am
   
please somebody help i stuck up
MohammadIqbal at 4-Oct-11 12:02pm
   
two fields means a seperate column for time ?
MohammadIqbal at 12-Oct-11 13:54pm
   
hello any help
Mark Nischalke at 12-Oct-11 22:46pm
   
What help do you want? You have already been told the calendar control does not provide time also. You have also been provided with information on how to add controls to the datagrid. In the time you have been waiting for someone to do this for you, you could have done it yourself.
 
If someone could have answered you they would have by now. Don't be so rude.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 4 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100