All events in the same row

Jun 10, 2010 at 10:50 AM

I have this problem for the last two days that all the events show in the same row and are overlapping each other. I tried setting the RowOverride on the TimelineEvents to -1, but the result was the same.

What could be the reason the row calculation is not working anymore (for me) and how can I fix it?

 

Jun 11, 2010 at 3:35 AM

please attach sample solution in issue tracking section. I will take a look.

Jun 14, 2010 at 11:10 AM

I figured out what causes the problem, but not how to fix it.

When the EndDate is not set, all TimelineEvents are displayed on the same row. You can easily reproduce that by commenting out the line in EventGenerator that sets the EndDate and run the sample.

Is EndDate not optional? If it is then the row stacking should still work if EndDate is not set.

 

Jun 16, 2010 at 4:48 PM
Please provide me with code from EventGenerator (updated) which does not work.
Jun 17, 2010 at 8:16 AM
// EventGenerator from SLEventGenerator
using System.Collections.Generic;
using TimelineLibrary;
using System;

public class EventGenerator
{
    #region Private Fields

    private DateTime                                    m_lastDate;
    private Random                                      m_rnd;

    #endregion

    #region Public Properties

    public List<TimelineEvent> Events
    {
        get;
        set;
    }

    #endregion

    public EventGenerator(
    )
    {
        m_lastDate = new DateTime(1980, 1, 1);
        m_rnd = new Random();
        Events = new List<TimelineEvent>(100);
    }

    public void GenerateEvents(
        int                                             amount
    )
    {
        int                                             daysLater;
        TimelineEvent                                   e;

        for (int i = 0; i < amount; i++)
        {
            //
            // one day to three weeks
            //
            daysLater = m_rnd.Next(1, 21); 

            m_lastDate = m_lastDate.AddDays(daysLater);

            e = new TimelineEvent();
            e.StartDate = m_lastDate;
            //This is the line that I meant. Commented out will result in all TimelineEvents on the same row
            //e.EndDate = m_lastDate;
            e.IsDuration = false;
            e.Link = "http://www.google.com";

            if (i % 3 == 0)
            {
                e.EventColor = "Red";
            }
            else if (i % 2 == 0)
            {
                e.EventColor = "Blue"; 
            }

            e.Title = String.Format("{0}", m_lastDate.ToShortDateString());
            e.Description = "Test Description.";

            Events.Add(e);
        }
    }
}

 

Jun 17, 2010 at 7:24 PM
EndDate was, indeed, not optional, but I think you right, it has to be optional. I added code in ResetEvent to fix it.