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

DataItem not available if ResourceCollection is filled manually

Asked by Oliver
8 years ago.

Hi,

I think my question is more a proposed change request for the behaviour.

In the OnBeforeResHeaderRender event there is a DataItem in the event data available.

I fill the ResourceCollection manually by creating Resource objects and setting the needed data. But if I set the DataItem property (which is get; set; enabled) I still do not get this dataitem in the event. In the documentation it says that this field is only available if filled by calling LoadResources().

I think it would be nice to change this to enable user to transport some additional data that might be interesting for rendering.

In my case I have a 2 level tree. 1st level is the group name and second level are the people in the group. Now I would like to determine if I render the group header or the person header to give it different style.

Is there another way to get some more info to the event?

Thanks in advance

Oliver.

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

This change is now implemented in the latest DayPilot Pro for ASP.NET MVC build (8.3.5851). You can download it in the sandbox:

http://mvc.daypilot.org/sandbox/

Any object passed using Resource.DataItem will be available as e.DataItem.Source in OnBeforeResHeaderRender.

Let me know if there is any problem.

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