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

Change color onclick through callback

Asked by Anonymous
8 years ago.

How can/should color for a event be changer onclick.
I get the event clicked in the callback but the BackGround color property is not available so how to get and change the EventObjects properties?

protected void DayPilotCalendar1_EventClick(object sender, DayPilot.Web.Ui.Events.EventClickEventArgs e)
{
string test = e.Text; -- Works but here I would like to find the object where I can set this.BackgroundColor or similar

}

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

You would have to store the value in the database or somewhere else in the WebForms, request a reload using Update() and set the new color in BeforeEventRender event handler.

However, you can do it directly on the client side:

EventClickJavaScript="changeColor(e)"

<script type="text/javascript">
function changeColor(e) {
e.client.backColor("red");
dps.events.update(e);
}
</script>

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