Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

I have a 3rd party calendar control (day pilot pro) and a label on my form.

i want my label to show the week number when a user clicks on any date on the calendar. My week number calculating method is working fine but my label does not update automatically. when I debug,I can see that my label.text has the right value, but it does not reflect on the page.

any good idea?? or label is not a suitable control for this purpose??
C#
protected void Page_Load(object sender, EventArgs e)
{
            if (!IsPostBack)
            {
                DayPilotCalendar1.StartDate = DayPilot.Utils.Week.FirstWorkingDayOfWeek(DateTime.Now);
                DayPilotCalendar1.Days = 7;
                DayPilotCalendar1.BusinessBeginsHour = 6;
                DayPilotCalendar1.BusinessEndsHour = 24;
                lblWkNumber.Text = "Week Number: " + gl.getWeekNumber(DayPilotCalendar1.StartDate); // displaying the week number
               
                string strMonthName = mfi.GetMonthName(DayPilotCalendar1.StartDate.Month).ToString();
                lblMonth.Text = strMonthName; //displaying the month name.
             }
}

protected void DayPilotCalendar1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
        {
            if (e.Command == "navigate")
            {
                DateTime dt = (DateTime)e.Data["start"];
                DayPilotCalendar1.StartDate = DayPilot.Utils.Week.FirstWorkingDayOfWeek(dt);
                lblWkNumber.Text = "Week Number: " + gl.getWeekNumber(DayPilotCalendar1.StartDate); // here i am changing the week number but it does not work !!

              
                DayPilotCalendar1.DataBind();
                DayPilotCalendar1.Update(CallBackUpdateType.Full);
               
            } 
Posted

1 solution

Hi
I used used Day pilot calendar, but i havent used any label to show the values. I used dappilotcalendar.eventname which worked for me.

May be you can try that way.

If you find any alternate please donr forget to post.

Regards
Naina
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900