I am trying to develop an employee overtime input from Telerik's RadCalendar object. To accomplish this task I am using the DayTemplate property of the RadCalendar. My aspx code looks like:
And the codebehind cs code is:
When the page is rendered everything seems OK.
Also when I navigate through the TextBoxes with the TAB key, still everything seems OK.
But when I try to select a spesific shift by clicking on it TextBox loses focus almost immediately. And even if I am quick enough to type a number into the textbox after losing the focus the text of the TextBox returns back to original value "0".
But again if I navigate to the day with the TAB key and change the value, the new value is kept.
So what am I doing wrong and what should I do to fix this error?
Regards.
| <CalendarDayTemplates> | |
| <telerik:DayTemplate ID="OvertimeTemplate"> | |
| <Content> | |
| <asp:TextBox ID="tbDayShift" Width="30px" MaxLength="1" Style="color: #0000FF; font-weight: bold;" Text="0" runat="server" /> | |
| <asp:TextBox ID="tbNightShift" Width="30px" MaxLength="1" Style="color: #FF0000; font-weight: bold;" Text="0" runat="server" /> | |
| </Content> | |
| </telerik:DayTemplate> | |
| </CalendarDayTemplates> |
| protected override void OnLoad(EventArgs e) | |
| { | |
| if (!IsPostBack) | |
| { | |
| base.OnLoad(e); | |
| DateTime startDate = new DateTime(base.Yil, base.Donem, 1); | |
| TimeSpan monthSpan = startDate.AddMonths(1) - startDate; | |
| for (int i = 0; i < monthSpan.Days; i++) | |
| { | |
| RadCalendarDay day = new RadCalendarDay(); | |
| day.Date = startDate.AddDays(i); | |
| day.TemplateID = "tmp1"; | |
| cal.SpecialDays.Add(day); | |
| } | |
| } | |
| } |
Also when I navigate through the TextBoxes with the TAB key, still everything seems OK.
But when I try to select a spesific shift by clicking on it TextBox loses focus almost immediately. And even if I am quick enough to type a number into the textbox after losing the focus the text of the TextBox returns back to original value "0".
But again if I navigate to the day with the TAB key and change the value, the new value is kept.
So what am I doing wrong and what should I do to fix this error?
Regards.