Is there somewhere to set the format of the Task Duration property to Hours at design time? I've found the method where at runtime i can call SetDuration and tell it hours but I have to do that each time the grid refreshes or tasks are added to keep it at hours. Otherwise it defaults to days and a task that would be 24 hours spread over 4 days shows as 1 single day on the grid.
I think I see your point...there is no way for you to tell the control to use a certain duration format by default. This should be a fairly simple change for us so you might want to submit a feature request.
I have found a workaround that will work for me and I submitted the feature request.
thanks for the quick reply.
Hi,
I’m checking to see if you can use any further help.
I don't think there is anything else you can help me with on this without the ability to set the time format at design time.
What I'm doing now is catching the event each time a task is created or modified and having to call the SetDuration method of the task object and tell it to use the hours format. Doing that messes up the PercentComplete property. I have a task that is 25% complete with hours format. Then the control switches it back to day format, lowers the percent complete to 6%, when I call sall SetDuration it adjusts the format but doesn't adjust the percentcomplete so I have to save off the original value first, call setduration, then put the value back.
float perc = tas.PercentComplete;
tas.SetDuration(tas.Duration, TimeSpanFormat.Hours);
tas.PercentComplete = perc;