Jijeshan009
Jijeshan009

Reputation: 73

Sharepoint DateTimeControl

In one of My pages i have a Sharepoint DateTimeControl.

SharePoint:DateTimeControl ID="dtpStartTime" runat="server" SelectedDate="" AutoPostBack="true" OnDateChanged="dtpStartTime_OnChanged" />



protected void dtpStartTime_OnChanged(object sender, EventArgs e)
    {

        if (dtpStartTime != null)
        {

            DateTime min = Convert.ToDateTime(dtpStartTime.SelectedDate.ToString());
            dtpEndTime.ClearSelection();
            Appointment objMgr = new Appointment ();
            objMgr.ManagerID = ddlMgr.SelectedValue;
            objMgr = objMgr.GetManagerByID(objMgr.ManagerID);
            dtpEndTime.SelectedDate = min.AddMinutes(objMgr.Duration);
        }

    }

How ever, the OnChanged event fires on date change, but i need the event to fire on time change also. Is there any possible way to solve this? any work around....

Thanks in advance....

Upvotes: 1

Views: 1516

Answers (1)

Dennis G
Dennis G

Reputation: 21798

The control does not Auto-Postback when the time is changed, hence you will not be able to have an event attached to it. You'll have to use a third party control (e.g. Telerik control are very good) or code your own.

Upvotes: 1

Related Questions