Regerating the list of the Gantt does not work correctly

Hi,

i attached a video and also th project.

Why i can't create the predecessor if i rebuild the gantt?

Best Regards
Gian Piero Truccolo

Attachment: PredecessorCreationNotAllowed3_a30f227f.zip

6 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team April 23, 2021 12:54 PM UTC

Hi Gian Piero Truccolo,

Greetings from Syncfusion.

We have checked the reported problem in the provided sample and it is due to collapsing the nodes immediately after generated it. We can overcome this problem by collapsing the nodes with little delay as like below snippet.
 
  
private async void RiGenerateGantt_Click(object sender, RoutedEventArgs e) 
{ 
    view.GenerateGantt(); 
    await Task.Delay(1); 
    GanttGrid.CollapseAllNodes(); 
} 

Please let us know if you have any queries.

Regards,
 
Sridevi S. 
 


Marked as answer

GI Gian April 23, 2021 02:39 PM UTC

Hi,

i have tested another situation an set the delay but the issue is not solved.
Push button 1 and then 2, i was trying to insert child for each activity.
After thoose operation i don't see any child.

Best regard
Gian Piero Truccolo

Attachment: ChildNotVisualize_11b534ca.zip


VR Vignesh Ramesh Syncfusion Team April 26, 2021 12:29 PM UTC

Hi Gian Piero Truccolo,

We can be able to reproduce the reported problem in the provided sample. Currently we are validating it and will update the further details on or before April 28, 2021. We appreciate your patience until then.

 
Vignesh Ramesh. 



SS Sridevi Sivakumar Syncfusion Team April 28, 2021 11:27 AM UTC

Hi Gian Piero Truccolo, 
  
Thanks for your patience. 
  
We have analyzed the provided sample, in that you have initialized the Child on demand. So, only the problem occurs. You can overcome this problem by initialize the Child collection in Model constructor instead as like below snippet. 
  
In Processi class 
  
public class Processi : INotifyPropertyChanged 
{ 
 
   public Processi() 
   { 
       Predecessor = new ObservableCollection<Predecessor>(); 
       Child = new ObservableCollection<Processi>(); 
   } 
} 
  
Please find the updated demo from the below link. 
  
Please let us know if you have any other queries. 
  
Regards, 
Sridevi S. 



GI Gian April 28, 2021 02:39 PM UTC

Hi,

but if i have only to recreate  the child should i must initialize the new istance of the object "Processi"?

Best regards
Gian Piero Truccolo


SS Sridevi Sivakumar Syncfusion Team April 29, 2021 11:48 AM UTC

Hi Gian Piero Truccolo,

Thanks for your response.

We have analyzed your query and achieved your requirement by initializing the Child collection on demand but before added it into the ItemsSource collection. Please find the snippet below
 
  
public void GenerateGantt() 
{ 
    Activities = new ObservableCollection<Processi>(); 
  
    foreach (DataSource Entity in DataSourceList) 
    { 
        … 
        Task.TaskId = Entity.Id; 
        Task.Child = new ObservableCollection<Processi>(); 
        Activities.Add(Task); 
        //Activities.Last().Child = new ObservableCollection<Processi>(); 
  
        //if (Entity.Child.Count() > 0) 
        //    AddChilds(Entity.Child, Activities.Last()); 
    } 
} 
 
public void AddChildsSeparately() 
{ 
    int Counter = 0; 
  
    foreach (DataSource FatherEntity in DataSourceList) 
    { 
        //Activities.ElementAt(Counter).Child = new ObservableCollection<Processi>(); 
        //Activities.ElementAt(Counter).Predecessor = new ObservableCollection<Predecessor>(); 
  
        foreach (DataSource Entity in FatherEntity.Child) 
        { 
            … 
            Task.TaskId = Entity.Id; 
            Task.Child = new ObservableCollection<Processi>(); 
            Activities.ElementAt(Counter).Child.Add(Task); 
            //Activities.ElementAt(Counter).Child.Last().Child = new ObservableCollection<Processi>(); 
        } 
        Counter++; 
    } 
} 

Also, please find the modified sample from the below link
https://www.syncfusion.com/downloads/support/forum/164764/ze/ChildNotVisualize688820025

We hope it helps you.

Regards,
Sridevi S. 
 
 


Loader.
Up arrow icon