This is a migrated thread and some comments may be shown as answers.

Updating RadCalendar to Overtime input

1 Answer 39 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Utku Ozan
Top achievements
Rank 1
Utku Ozan asked on 23 Feb 2009, 09:57 AM
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:

<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> 
And the codebehind cs code is:

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); 
        } 
    } 
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.

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 26 Feb 2009, 09:50 AM
Hello Utku Ozan,

I could not reproduce such a problem. I am sending you a sample application similar to yours for comparison.

Hope it will help you with your implementation.

All the best,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
Utku Ozan
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or