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

how to create new events in daypilot lite .Please help me

Asked by Anonymous
16 years ago.
I am trying to create a mousedown event in daypilot lite.How can i create new events in daypilot lite
Please help me
Thanks
Comment posted by Dan Letecky
16 years ago.
The best way is to handle FreeTimeClick (either on the server side or using JavaScript). You can redirect it to a special page where the user can enter the event details or you can show a modal dialog using ASP.NET AJAX and then refresh DayPilotCalendar placed inside UpdatePanel....
Comment posted by Alec
16 years ago.

I'm just starting out with DayPilot...

I'm using the ajax modal dialog for displaying the freetimeclick start date and time (as a test), but I get two copies of the dialog one after the other.One gets displayed andthen disappears, and then the second onewhich has the valuesI actually want displayed.

The first one dialog that is shown uses the values from the last postback (or no value if this is the first postback). The second version of the dialogue shows the correct values, as handled by the server-side event handler on this postback.

If I place a breakpoint on the server side code, I notice that the first modal is displayed purely by client-side code - that is, no postback occurs before the dialog is displayed. After the first dialog disappears, the postback event is handled and the second version of the dialog is shown.

My ASPX code:

<DayPilot:DayPilotCalendar ID="dpcClinic" runat="server" Days="5"
OnEventClick="DayPilot_EventClick" OnFreeTimeClick="DayPilot_FreeTimeClick"
HeaderDateFormat="D" EventClickHandling="PostBack"
FreetimeClickHandling="PostBack" DataEndField="ApptEnd"
DataStartField="ApptStart" DataTextField="ApptDesc" DataValueField="ApptID"></DayPilot:DayPilotCalendar>

<cc1:ModalPopupExtender ID="mpeAddBooking" runat="server"
PopupControlID="pnlAddBooking" TargetControlID="dpcClinic"
CancelControlID="cmdAddCancel" BackgroundCssClass="modalBackground"
EnableViewState="false">
</cc1:ModalPopupExtender>
<asp:Panel runat="server" ID="pnlAddBooking" CssClass="modalPopup" style="display: none;">
<div>
<p><asp:Label ID="lblBookingStart" runat="server" Text=""></asp:Label></p>
<p><asp:Button ID="cmdAddCancel" runat="server" Text="Cancel" /></p>
</div>
</asp:Panel>

...And my VB code:

Protected Sub DayPilot_FreeTimeClick(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.FreeClickEventArgs) Handles dpcClinic.FreeTimeClick
'Some event handling
Me.lblBookingStart.Text = "Start date selected as: " + e.Start.ToShortDateString
Me.lblBookingStart.Text += "<br />Start time selected as: " + e.Start.ToShortTimeString
Me.mpeAddBooking.Show()
End Sub

Comment posted by Alec
16 years ago.

I also notice that a property reference for the ModalPopupExtender is appearing in the properties list for the DayPilotCalendar.

Would this somehow be related to whythe modal is activating before the postback event that shows the modal?

Comment posted by Alec
16 years ago.

PS: I'm using VS2008 SP1, with solution targetting framework 3.5 (also SP1), in case that's relevant to the behaviour I'm seeing.

Comment posted by Alec
16 years ago.

Sorted it - found the answer in your DemoSQL examples, by adding the dummy button for the target control of the modal.

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