10418 : I am trying to conditionally allow or prevent the moving/resizing of timebars

Question

I am trying to conditionally allow or prevent the moving/resizing of timebars on the calendar based on certain conditions. I have read the helpfile and a KB article on the topic but i still dont understand how to manipulate a time item’s move/resize properties.

The reply to the KB question reads….
_________

Answer

In phGantTimePackage this can be handled with properties on the IphGantRow3.

IphGantRow3.TimeItems_CanChangeRow=false
IphGantRow3.TimeItems_CanMove=false
IphGantRow3.TimeItems_CanResize
_____________

So this is on a ROW basis? Cant i have do this down at the timebar level??

Also, i dont understand the naming convention of “IphGantRow3.TimeItems_CanResize”. 

My code to populate the treeview and to draw timebars is shown below.  Can you show where and how in my code to allow/prevent a timebar from being moved or resized??  I was hoping to do something like the following but it DOES NOT work:

tTime.AllowMove = .t.
tTime.AllowChangeRow = .t.
tTime.AllowResizeEast = .t.
tTime.AllowResizeWest = .t.

Answer

You are correct that the “Allow” properties are set per row. This is a design limitation (or flaw) to the phGantTimePackage that has been fixed in the GTP.NET. The workaround for phGantTimePackage user to get conditional AllowResizeEast etc is to implement the IphGantX3.OnBeforeCanEditGantTime and in this event evaluate what the correct settings for the properties should be and update them on the row.

 

Leave a Reply