This is a migrated thread and some comments may be shown as answers.

Migration from Q1 to Q2 version

1 Answer 54 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Paweł
Top achievements
Rank 1
Paweł asked on 22 Oct 2012, 07:22 AM
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ł

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Oct 2012, 08:28 AM
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.

Tags
GanttView
Asked by
Paweł
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or