10206 : How can I select a timeitem in the gantarea

Question

How can I select a timeitem in the gantarea by selecting an item from a combobox? ID from combobox is set in UserIntegerReference

Answer

You need to iterate the Gantt and find the time item with the correct UserIntegerReference. Once you have it you can set the Selected property to true on the time item, and if you want it focused you set IphGantX3.SetCurrentDataEntityGantArea(ti)

You can use the IphDataList3lev.FindFromUserIntegerReference to search all the time items like this

phGant.IphGantX3.AllDataEntities.FindFromUserIntegerReference(x), it will then return the first time item with x in its UserIntegerReference.

Or you can iterate thru the datastructure:

  for(int i=0;i<axphGantX1.DataList3levGantTimes().Count();i++)

  {
    phGantXControl.IphDataList2lev aList2Lev=axphGantX1.DataList3levGantTimes().get_DataList2Lev(i);
   

for(int ii=0;ii<aList2Lev.Count();ii++)

    {
      phGantXControl.IphDataList aList=aList2Lev.get_DataList(ii);
     

for(int iii=0;iii<aList.Count();iii++)

      {
        phGantXControl.IphDataEntity_GantTime2 aGantTime=aList.get_Items(iii)

as phGantXControl.IphDataEntity_GantTime2;

        aGantTime.Start=aGantTime.Start.AddDays(1);
        aGantTime.Stop=aGantTime.Stop.AddDays(1);
      }
    }

 

Leave a Reply