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

How to use?

Asked by Anonymous
11 years ago.
I just downloaded trail versions but I cannot find any document that how to use the control.

How to display events in the DayPilotCalendar? I got data in the dataset. The new page need to open if the click on the even text.
Example:
9.30am. Address1: installation
9.30am. Address2: Setup
Comment posted by Anonymous
11 years ago.

Hi,

Its working fine except the URL.

Can you please guide me how to display URL ?

Thanks

Raj

Comment posted by Anonymous
11 years ago.

Hi,

Can you explain me the following areas?

1). I need to redirect the page if the client click on the event.

2). How to change the event color based on event type?

Thanks

Raj

Comment posted by Dan Letecky
11 years ago.
Hi Raj:

1. Set EventClickHandling property to JavaScript (either in the ASPX template or in the code) . Set EventClickJavaScript to the following code:

EventClickJavaScript="document.location='NewPage.aspx?id=' + e.value()"

2. Handle BeforeEventRender event and modify e.BackgroundColor (see Demo/Horizontal/CustomEventFormatting.aspx.cs sample)

protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
  if (e.Value == "2")
  {
    e.LeftBarColor = "red";
    e.BackgroundColor = "lightyellow";
  }
}

You can store your event type in DataTagField and then access it in this event handler as e.Tag.

Let me know if this helps. Any other questions are welcome.
Comment posted by Anonymous
11 years ago.

Hi Dan,

The URL working fine and display the right pk value (t6UJ9A004I1U) if the clients click on the event. Thanks much for that. However, the second requirement unable to achieve.
protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
if (e.Value == "t6UJ9A004I1U")
{
e.LeftBarColor = "red";
e.BackgroundColor = "lightyellow";
e.InnerHTML = "<i>WARNING: This is an unusual event.</i><br>" + e.InnerHTML;
}
}

I tried the above code unfortunately not working. Is anywhere do I need to enable the property?
Can I change the property of EventClickJavaScript at DayPilotCalendar1_BeforeEventRender dynamically? Like below.
if (e.Value.Substring(1, 1) == "t")
{
DayPilotCalendar1.EventClickJavaScript = "document.location='wfTdts.aspx?id=' + e.value()";
}
else
{
DayPilotCalendar1.EventClickJavaScript = "document.location='wfOpdts.aspx?id=' + e.value()";
}

Thanks

Raj

Comment posted by Anonymous
11 years ago.

Can you guide me how to add the control dynamically?

Comment posted by Anonymous
11 years ago.

Hi,

I found it how to add dynamically on the control. but please reply the my previews question.

Thanks

Have nice week end.

Comment posted by Anonymous
11 years ago.
all working fine. I have posted separately about Dynamic object event handling issue.
Comment posted by Dan Letecky
11 years ago.
OK, Thanks for a report. I'll check the other question.
Comment posted by Dan Letecky
11 years ago.
See the solution for JavaScript handling in the separate topic:

http://forums.daypilot.org/Topic.aspx/97/event_click_javascrip_dyanmically
This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.