Click here to Skip to main content
15,904,494 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anybody tell me how to print datetime picker values ? Is there any way to get values of datetime picker save it to some string and finally print it along with datagrid view ?
Posted

you need to save this value in label and hide it but on print css you need to display block this control and it will surely in print page.
 
Share this answer
 
Comments
shoebass 24-Jul-11 3:16am    
how do we achieve that?
this code will input datetime picker value in integer values

step1:

drag and drop date time picker
choose event ValueChanged
dateTimePicker1_ValueChanged

C#
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
       {

           int Month=int.Parse( dateTimePicker1.Value.Month.ToString());
           int Day =int.Parse( dateTimePicker1.Value.Day.ToString());
           int Year=int.Parse(dateTimePicker1.Value.Year.ToString());
           int Hour = int.Parse(dateTimePicker1.Value.Hour.ToString());
           int Minute = int.Parse(dateTimePicker1.Value.Minute.ToString());
           int Second = int.Parse(dateTimePicker1.Value.Second.ToString());

           dataGridView1[0,0]=Month;
           dataGridView1[0, 1] = Day;
           dataGridView1[0, 2] = Year;
           dataGridView1[0, 3] = Hour;
           dataGridView1[0, 4] = Minute;
           dataGridView1[0, 5] = Second;

       }
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900