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

Get ItemSource in BeforeEventRenderEventArgs after Postback

Asked by r2b2s
11 years ago.

Hi,
I use e.DataItem.Source for get some values of my events items in BeforeEventRenderEventArgs for initialize some values of event (html, backcolor, contextmenu...). I set StoreEventsInViewState=true of my DayPilot Calandar. e.DataItem.Source will be nothing after postback and of course i can't calculate my own values.

Some one have any ideas....

Thanks

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

The e.DataItem is only available in BeforeEventRender on the server side.

For additional data that need to be passed with the event through all its lifecycle you should use tag fields (*DataTagFields* property).

These fields will be available in BeforeEventRender, in client-side event handlers as e.tag("name"), in server-side event handlers as e.Tag["name"].

Example:
<DayPilot:DayPilotCalendar 
...
DataTagFields="color, status" />
EventClick handler:
string status = e.Tag["status"];

See also here:
http://doc.daypilot.org/calendar/event-loading/

Comment posted by r2b2s
11 years ago.

OK Thank very helpfull

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