TimeLine Events

Sep 1, 2010 at 3:35 PM
Edited Sep 1, 2010 at 3:43 PM

Hi Team,

Excellent control,

Iam trying to implement the timeline in a siverlight project ,but i have issues  in adding events(i have more than 200 events ) in the Timelinetray 

As a work around i thought of adding the timelinetray's in different tabpages with maximun of 20  events  in each page but iam unable to add the timelinetray dynamically.Can anyone suggest a fix for the above.

Sep 1, 2010 at 4:46 PM

200 events should not be a problem for the control, unless they all happen at the same time and overlap visually. You actually can create TimelineTray dynamically. I would be able to better help you if you submit a bug with your solution which is not working.

Sep 2, 2010 at 8:06 AM
Edited Sep 2, 2010 at 2:25 PM

Hi Andrewsyrov,

Thanks for the reply,

The events are more than 200 (exactly 287) and they do overlap on each other.I actually decreased the event length of hours to "2" so that the timeline accomidates all the events,but still i have a error saying

"Index out of Range"

I need to show all the events so that teh user comapres the events.

Instead as a workaround as used tagpages(so that i can show all the 267 events in a tabcontrol)

but unable to initialize the timelinetray: I used the follwing code:

timelinetray =new TimelineTray();

 

timelinetray.CultureID ="en-US";

 

timelinetray.CalendarType ="gregorian";

 

timelinetray.InitialDateTime =DateTime.Now;

Convert.ToDateTime("01/01/2010");

timelinetray.MaxDateTime =Convert.ToDateTime("01/01/2050");

 

 

 

timelinetray.AddTimelineBand(0,true, "hours", 24, 4);

timelinetray.AddTimelineBand(25,false, "days", 30, 4);

timelinetray.AddTimelineBand(25,false, "months", 6, 4);

  

 

TabItem ti = new TabItem();
 
 

ti.Header ="Page"+tabs.ToString();

   

ti.Content = timelinetray; 

 

 

 

tbTimeline.Items.Add(ti);

 

but it throws the following error:

"Null referenceException " in Timelinetray.cs ,AddTimelineBand method at

m_notifier.AddElement(band);

Iam i adding the control right in the right way,your views plz on both the issues.

Thanks in advance.

 

Sep 2, 2010 at 4:49 PM

would be much easier for me to investigate if you open a bug and attach you solution to it.

Sep 2, 2010 at 5:32 PM

Hi Andrew,

i came away from ofc...the sln file is there..can you let me knwo how to add the control dyanamically in silvelrlight....?

Sep 2, 2010 at 10:42 PM

take a look at WPFTimelineToggleBands sample from sources. Thanks.

Sep 6, 2010 at 8:44 AM
Edited Sep 6, 2010 at 10:58 AM

I tried this method also but failed again :(

 

Iam unable to get new time line event for each tab :(

 

private void Createtabpage(XDocument doc, int tabcount)

{

_timeline =new TimelineTray();

 

 

 

{

Name=tabcount.ToString(),

TimelineTray timeline= new TimelineTray

CalendarType ="gregorian",

HorizontalAlignment =HorizontalAlignment.Stretch,

 

MinDateTime =Convert.ToDateTime("01/01/2010"),

MaxDateTime =Convert.ToDateTime("01/01/2050"),

 

InitialDateTime =DateTime.Now,

CurrentDateTime =DateTime.Now,

 

Height = 700

};

_timeline = timeline;

timeline.Loaded += (x, y) => timeline.ResetEvents(doc); 

 

 

 

TabItem ti = new TabItem();

ti.Name ="Timeline" + tabcount.ToString();

ti.Header ="Timeline" + tabcount.ToString();

ti.Content = timeline;

 

int bandNr = 0;

SetupBand("hours", ref main, ref bandNr);

main =false;

bandNr++;

SetupBand("days", ref main, refbandNr);

bandNr++;

SetupBand("months", ref main, refbandNr);

 

}

 

 

tbTimeline.Items.Add(ti); 

 

bool main = true;