Click here to Skip to main content
15,898,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,

In my project I need to enter the machine running time , Total running time and Idle time in datgridview cells .

Here I want to set the time format in datgridview cells, which means I just enter only the number ,system will separate the hour and minutes.

For an example:
I am just typing only the numbers 1100,1200 like vise.

starttime endtime totaltime idle time
11:00AM 12:00PM 13:00 02:00

How can I do this. Here total time will calculate automatically based on the start and end time . How can I do this , please anybody help this question I need to finish it quickly.

Thanks in advance.
Posted

1 solution

Add a timer to the form.
Then in every timer tick, update the gridview.
C#
private void timer1_Tick(object sender, EventArgs e)
{
    // Update DataGridView
}


Updating the cell every few seconds will give you better performance.
If you have a large number of rows/cells to update then increase the update interval.
 
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