10360 : phGantTimePackage Virtual load

Question

I am finding Virtual load difficult to use in my project, may be due to lack of knowledge regarding the working of phGantt Chart Virtual View. I am handling task management using the phGantt Chart. Following is the data structure that I have used for managing tasks internally.< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Class CTask
{
      CString m_strTaskName;
      COleDateTime m_dtStartDate;
     
COleDateTime m_dtDueDate;
      
// …. More declarations goes here

      CTaskList   m_SubtaskList; // Sub nodes

};

 

Q1) How and when do I associate CTask* as UserVariant Reference for the nodes?

Q2) I tried using AddDataEntityTree() method for adding subnodes on the callback function? Can’t get it? An example would be appreciable?

 

Answer

I would associate the CTask instance with the TimeItem in the IphGantX3.OnVirtualLoadGrid event, put it in the pointer in the UserIntegerReference.
 
In the IphGantX3.OnVirtualLoadGrid you can add subnodes to the RootNode by calling: IphGantX3.AddDataEntityTree(theRootNode), but I think your problem is with getting the theRootNode corresponding to this virtually loaded row…
 
This is understandable but this what you need to know:
The sent in theRowIndex is the index of the root dataentity tree, so you can access it with IphGantX3.RootDataEntitiesTree(theRowIndex)
 
So you can add subnodes like this:
IphGantX3.AddDataEntityTree(IphGantX3.RootDataEntitiesTree(theRowIndex))
   
 

Leave a Reply