Generating bubble content on the server side

RenderContent event

The Bubble content is generated on the server side using a callback request. Every request fires a RenderContent event.

  • The Render event handler receives DayPilot.Web.Ui.Events.Bubble.RenderEventArgs. This class is generic and only helps you with identifying the source control (SourceUniqueID property).
  • You need to identify the class type and cast it acordingly. It can be one of the following classes:
    • RenderCellBubbleEventArgs (Start, End, and ResourceID properties)
    • RenderEventBubbleEventArgs (Value property)
    • RenderResourceBubbleEventArgs (ResourceID property)
  • The output HTML should be set using InnerHTML property.

Example

    protected void DayPilotBubble1_RenderContent(object sender, RenderEventArgs e)
    {
        if (e is RenderEventBubbleEventArgs)
        {
            RenderEventBubbleEventArgs re = e as RenderEventBubbleEventArgs;
            re.InnerHTML = "<b>Event details</b><br />Here is the right place to show details about the event with ID: " + re.Value + ". This text is loaded dynamically from the server.";
        }
        else if (e is RenderResourceBubbleEventArgs)
        {
            RenderResourceBubbleEventArgs re = e as RenderResourceBubbleEventArgs;
            e.InnerHTML = "<b>Resource header details</b><br />Value: " + re.ResourceId;
        }
        else if (e is RenderCellBubbleEventArgs)
        {
            RenderCellBubbleEventArgs re = e as RenderCellBubbleEventArgs;
            e.InnerHTML = "<b>Cell details</b><br />Resource:" + re.ResourceId + "<br />From:" + re.Start + "<br />To: " + re.End;
        }
    }