Question #1:
The DayPilot control might be inside another control. Use this method:
private static Control recursiveFind(Control parent, string id)
{
Control found = parent.FindControl(id);
if (found != null)
return found;
foreach (Control c in parent.Controls)
{
found = recursiveFind(c, id);
if (found != null)
{
return found;
}
}
return null;
}
And call it this way:
DayPilotCalendar dpc = recursiveFind(this.NamingContainer, "DayPilotCalendar1");
Question #2:
Handle BeforeEventRender event and modify e.InnerHTML property. The demo can be seen here:
http://www.daypilot.org/demo/Horizontal/CustomEventFormatting.aspx
The source code is included in the DayPilot Pro package (both full and
trial).