Migration from Q1 to Q2 version

2 posts, 0 answers
  1. Paweł
    Paweł avatar
    11 posts
    Member since:
    Jun 2012

    Posted 22 Oct 2012 Link to this post

    Hello again,

    We've just moved from Q1 to Q2 version of Silverlight Controls. Everything is ok but parts responsible for RadGanttView functions. 
    Previously, to fill RadGanttView, I had this part of code:

    public void SetGanttItems(IEnumerable<Activity> initialSet)
            {
                Activities = new ObservableCollection<IGanttTask>(); 
                var wrapperCollection = initialSet.Select(a => { return WrapActivity(a); }); 
                foreach (var activity in wrapperCollection)
                    Activities.Add(activity);
            }

    private GanttTask WrapActivity(CMSActivity activity)
            {
                GanttTask result = new GanttTask(activity.PlannedStartDate ?? new DateTime(), activity.PlannedEndDate ?? new DateTime(), activity.Title);
                
                List<Relation> relations = new List<Relation>();
                List<GanttTask> children = new List<GanttTask>();
     
                foreach (var child in activity.Children)
                {
                    GanttTask wrappedChild = WrapActivity(child);
                    relations.Add(new Relation() { Task = wrappedChild });
                    children.Add(wrappedChild);
                }
     
                result.SetRelations(relations);
                result.SetChildren(children);
                return result;
            }
    
    When I migrated to new version, I cannot compile the code due to errors in method WrapActivity.
    Problem is that now I cannot find Relation class. I found RelationInfo, but it accepts strange objects in constructor, so
    I'm not sure whether should I use it, or maybe somewhere good, old Relation class still exists...
    
    I'd appreciate if someone could provide me with sample code with functionality similar to code listed above and working
    with Q2 version.
    Best regards, thank you in advance.
    Paweł
    
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Oct 2012 Link to this post

    Hello Pawel,

    The GanttView control used to be in CTP stage in Q1 and in Beta stage in Q2, so I\d advise you to move forward to Q3 where the GanttView control for Silverlight is in stable state. The Relation class from Q1 is now replaced with the Dependency class and the Relations collection is renamed to Dependencies. The Dependencies have a little bit different meaning now - they have exactly the opposite direction than the Relations used to have. For more information about the changes in the GanttView control and the backwords compatibility please refer to this help article.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top