search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to add additional data in day pilot event

Asked by krishnan
7 years ago.

Hi Team,
Currently i want to get and set event specific data in day pilot calendar while rendering the event.
Iam displaying Name of the client it is supplied as e.inner html .i would like to store client id also for pirticular event which should not be displayed in the ui .
please help asap

Answer posted by Dan Letecky [DayPilot]
7 years ago.

Hi krishnan,

The event source object (from DataSource) is available in BeforeEventRender event handler as e.DataItem (e.DataItem.Source).

Example:

    protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
    {
        e.DurationBarColor = e.DataItem["color"] as string;
    }

You can also specify custom fields using DataTagFields property. These fields will be available during all the event lifecycle (on the client side as well).

Example:

.aspx
<DayPilot:DayPilotCalendar .... DataTagFields='color' ... />
.aspx.cs
    protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
    {
        e.DurationBarColor = e.Tag["color"];
    }
Comment posted by Anonymous
7 years ago.

Thank you very much ..
i think we have to make a document with all these points.. i didnt find these stuf any where in Daypilot documentation

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.