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

Can't change TimeRangeSelectedHandling at runtime

Asked by Jimmie Andersson
15 years ago.


I have some problem changing TimeRangeSelectedHandling server-side.

I'm using buttons outside the calendar to do things server-side, When I then try to set CallBack as Handling, nothing happens.

I'm updating the calendar like you guys helped me with before

I'm running .NET 3.5

Changing date as in my example works great.
Below are my code attached.

Thank you very much.
Love this control!



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tmpCalendar.aspx.cs" Inherits="tmpCalendar" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
<title>Untitled Page</title>
<form id="form1" runat="server">

<asp:ScriptManager runat="server" ID="ScriptMgr" EnablePartialRendering="true" EnableScriptGlobalization="true" />

HeaderDateFormat="dddd d MMMM yyyy"



<a href="#" onclick="javascript:dpc1.commandCallBack();">Test (no update panel)</a>

<asp:UpdatePanel ID="uplPanel1" runat="server" UpdateMode="Conditional">
<asp:Button ID="btnAdd" runat="server" OnClick="BtnAdd_Click" Text="Test (inside update panel)" />




using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DayPilot.Web.Ui.Events;
using DayPilot.Web.Ui.Events.Bubble;
using DayPilot.Web.Ui.Enums;

public partial class tmpCalendar : System.Web.UI.Page
private int FPNumDays
get { return (int)ViewState["numDays"]; }
set { ViewState["numDays"] = value; }

protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
this.FPNumDays = 7;

dpcWeekCalendar.StartDate = DayPilot.Utils.Week.FirstDayOfWeek(DateTime.Today); ;
dpcWeekCalendar.Days = this.FPNumDays;
dpcWeekCalendar.TimeFormat = DayPilot.Web.Ui.Enums.TimeFormat.Clock24Hours;
dpcWeekCalendar.HeightSpec = DayPilot.Web.Ui.Enums.HeightSpecEnum.BusinessHours;

protected void BtnAdd_Click(object sender, EventArgs e)
this.FPNumDays = 14;
ScriptManager.RegisterClientScriptBlock(uplPanel1, this.GetType(), "refresh", "javascript:window.setTimeout('dpc1.commandCallBack()', 100);", true);


protected void DpcWeekCalendar_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
dpcWeekCalendar.TimeRangeSelectedHandling = DayPilot.Web.Ui.Enums.TimeRangeSelectedHandling.Disabled;
dpcWeekCalendar.StartDate = dpcWeekCalendar.StartDate.AddDays(this.FPNumDays);


protected void DpcWeekCalendar_TimeRangeSelected(object sender, TimeRangeSelectedEventArgs e)



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