PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET FAQ 11039


How to get the snapped time values in the Gantt1_OnTimeItem_StopValueResize event? Please note that this article refers to the GTP.NET
Jump to article- 2007-10-31 11:02:00 - Email plexityHide
Question
 
I have a gantt chart/grid where I have set the start and stopsnap times. After I change the stop time of timeitem, the cooresponding column in the grid changes to the 'snapped' time.  How can I get this value to use instead of the true time from the Gantt1_OnTimeItem_StopValueResize event?

Trying: e.TimeItem.GanttRow.GridNode.GetCell(3).Content.Value
gives me the original stoptime of the timeitem and : Gantt1.FocusedTimeItem.Stop.Add(e.Diff).ToString
gives me the new stoptime w/out being snapped as indicated.

Thank you for your help.
Answer
 
The snapping is calculated after the OnTimeItem_StopValueResize event, but you can use the same logic we do to calculate the snapped value: Gantt.DateScaler.SnapTime(time,precision).
 
So try this:
TimeBeforeSnap=e.TimeItem.Stop.Add(e.Diff);
TimeAfterSnap=Gantt1.DateScaler.SnapTime(TimeBeforeSnap,e.TimeItem.TimeItemLayout.SnapStopTime);
 
 

 

Google
WWW plexityHide GTP.NET FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ GTP.NET.SL and WPF

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...




class="blk">PlexityHide.com
Grastensvagen 24, S-163 45 Spanga Sweden
E-mail: support@plexityhide.com