I was attempting the solution offered in this article:
http://forums.daypilot.org/Topic.aspx/118/how_to_create_dynamically_the_calendar
In addition, I wanted to register some of the events. For example:
DayPilotCalendar cal = new DayPilotCalendar();
cal.BeforeEventRender += new DayPilot.Web.Ui.Events.BeforeEventRenderEventHandler(DayPilotCalendar_BeforeEventRender);
Then, I attempted to bind the calendar to a datasource, ie:
cal.DataSource = someList; // Generic list of applicable data objects
cal.DataBind();
I've tried creating the calendars and binding them in Page_Load (inside and out of the IsPostback check) and Page_Init. I also tried by overriding CreateChildControls.
No matter how I try, however, I cannot get the calendars to actually bind to anything! I get only empty calendars that are otherwise properly rendered. When I put a break point in the method that binds the calendars, it does actually stop, but nothing gets rendered. When I put a break point inside the BeforeEventRender method, however, it NEVER stops!
Also, if I add handlers for DataBinding and Databound and add breakpoints there, the code does stop.
Lastly, on my page I have the following control:
<asp:Table ID="tblCalendar" runat="server">
</asp:Table>
During the calendar creation, I create a new TableRow:
TableRow row = new TableRow();
tblCalendar.Rows.Add(row);
Then, I add the calendars like this:
TableCell cell = new TableCell();
cell.Controls.Add(cal);
row.Cells.Add(cell);
Note: these problems do not happen when I do not attempt to dynamically add the calendars at runtime.
Is there something that I am missing? I can't think of what I could be missing here. Any insights would be great.
Thanks!