This is a migrated thread and some comments may be shown as answers.
Read content of created control
1 Answer 6 Views
This is a migrated thread and some comments may be shown as answers.
David Penny
Top achievements
Rank 2
David Penny asked on 12 Aug 2013, 03:43 PM
Hi,

I have a scenario where I want the user to be able to type in the number of hours to allocate to a task on the Calendar. To do this I have created a textbox to enter the data into using:

Protected Sub RadCalendar1_DayRender(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) Handles RadCalendar1.DayRender
    Dim label As New Label()
    label.Text = e.Day.[Date].Day.ToString()
    e.Cell.Controls.Add(label)
    Dim dayOfWeek As String = e.Day.[Date].DayOfWeek.ToString()
    If dayOfWeek <> "Saturday" And dayOfWeek <> "Sunday" Then
        Dim txtBox As New TextBox()
        txtBox.Text = "xx" 'Will be read from database
        e.Cell.Controls.Add(txtBox)
    End If
End Sub

The question I have now is how to I read all the days of the Calendar, get the contents of each textBox and do something with it? I would like to do this server side.

I've spent some time with the documentation without finding anything that fits the bill.

David Penny

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 15 Aug 2013, 01:39 PM
Hello David,

I am sorry to say but the server-side API does not expose a method which allows the traversing of the day cells. That said you can meet the requirements in two ways:
  1. Attach an event handler for the OnTextChanged event of the text boxes inside the cells and once the value in one of them is changed on the server store it in a separate structure.
  2. Do the same but on the client and send the information via an AJAX request.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Asked by
David Penny
Top achievements
Rank 2
Answers by
Angel Petrov
Telerik team
Share this question
or