1,105,263 Community Members

datetime picker display data

Member Avatar
judithSampathwa
Posting Pro in Training
453 posts since May 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi
i have a question relating to a date time picker,
i have a form that i have the employee name and all the emaloyee details such as the employee DOB. whena user selects a user from the combo box the details from the database is being taken and displayed in the form. that thing is i have a date time picker and in the form load i have the code

dpDOB.Format = DateTimePickerFormat.Custom;
            dpDOB.CustomFormat = " ";

and in the datetime picker close up i have the code

dpDOB.Format = DateTimePickerFormat.Short;

and when it shows the data the datetime picker value does is not displayed, i have to click the datetime picker for the value to show up

how can i solve this.

thanks

Member Avatar
hericles
Veteran Poster
1,078 posts since Nov 2007
Reputation Points: 98 [?]
Q&As Helped to Solve: 232 [?]
Skill Endorsements: 14 [?]
Featured
 
0
 

Add this line:
dpDOB.Format = DateTimePickerFormat.Short;
to the code that draws the info from the database. Just place under the rest and it should work. The problem at the moment is that you only have it in the dateTimePicker code segment which is only getting called when you click on it.

Member Avatar
judithSampathwa
Posting Pro in Training
453 posts since May 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Add this line:
dpDOB.Format = DateTimePickerFormat.Short;
to the code that draws the info from the database. Just place under the rest and it should work. The problem at the moment is that you only have it in the dateTimePicker code segment which is only getting called when you click on it.

thanks

Question Answered as of 2 Years Ago by hericles
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: