动态更新DayPilot日历中的标签 [英] Dynamically update a label in DayPilot Calendar
本文介绍了动态更新DayPilot日历中的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
我的表单上有一个第三方日历控件(日间飞行员专业版)和一个标签.
我希望我的标签在用户单击日历上的任何日期时显示星期数.我的周数计算方法可以正常工作,但我的标签不会自动更新.调试时,我可以看到我的label.text具有正确的值,但是它没有反映在页面上.
有什么好主意吗?或标签不适用于此目的?
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??
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);
}
推荐答案
嗨
我使用了Day试用日历,但没有使用任何标签来显示值.我使用了对我有用的dappilotcalendar.eventname.
也许您可以尝试这种方式.
如果您发现其他任何替代方法,请别忘了发布.
问候
奈娜(Naina)
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
这篇关于动态更新DayPilot日历中的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文