Hi. I've a problem using custom headers. It all works perfect untill I change the date selection, then the date header remains the same but all of my events disapear. WHen I click back to the current date all works fine.
My code is
On page load I call
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
defineColumns();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
private void defineColumns()
{ DayPilotCalendar1.Columns.Clear(); //Clear any cuurrent colums from memory
DateTime first = DayPilot.Utils.Week.FirstDayOfWeek();
string[] resources = new string[] { "1", "1", "1", "1", "1", "1", "1" }; //We only use on column!! therefore each column is "1"
string[] headers = new string[] ("8 till 18", "5 till 14", "7 till 15", "6 till 16", "5 till 17", "0 till 0", "0 till 0" )};
for (int i = 0; i < 7; i++) //iterate from 0 t 6 (7 days)
{
DateTime day = first.AddDays(i);
Column c = new Column(day.ToShortDateString(), resources[i]);
c.Date = day;
DayPilotCalendar1.Columns.Add(c);
for (int j = 0; j < 1; j++)
{
Column subC = new Column(headers[i], resources[i]);
subC.Date = day;
c.Children.Add(subC);
}
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am sure it must be something to do wwith this line
DateTime first = DayPilot.Utils.Week.FirstDayOfWeek();
But I cannot get it to work.
Any ideas?
Thanks LL