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

e.Container.FindControl("RecurrentAppointment") returns "Nothing"

2 Answers 83 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Pasquale
Top achievements
Rank 1
Pasquale asked on 09 Apr 2015, 10:27 AM

Hi,

i implemented an .aspx page, with a RadScheduler.

1. <telerik:RadScheduler ID="RadScheduler1" runat="server" Culture="Italian (Italy)"     ProviderName="AllotmentSchedulerData" SelectedView="TimelineView" DayEndTime="08:00:00" AdvancedForm-EnableCustomAttributeEditing="True" CustomAttributeNames="Contingente Camere,Release,Attivo,explode" RowHeight="55px" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" ShowHoursColumn="False" WorkDayEndTime="08:00:00"       OverflowBehavior="Expand" Style="top: 0px; left: 0px" MonthHeaderDateFormat="MMMM, yyyy" StartInsertingInAdvancedForm="True" >
   <AppointmentTemplate>
    <asp:Label runat="server" ID="RecurrenceIcon" />
    <%# Eval("Subject") %>
    <asp:Label runat="server" ID="TCpL" />
    <asp:Label runat="server" ID="TCL" />
   </AppointmentTemplate>
   <MonthView VisibleAppointmentsPerDay="5" HeaderDateFormat="MMMM, yyyy" />
   <TimelineView HeaderDateFormat="dd/MM/yyyy" NumberOfSlots="25" SlotDuration="1.00:00:00" ColumnHeaderDateFormat="dd/MM" ShowInsertArea="true" GroupBy="roomType" GroupingDirection="Vertical"  /><DayView DayEndTime="08:00:00" ShowHoursColumn="False" WorkDayEndTime="08:00:00" UserSelectable="False" /><WeekView UserSelectable="False"/>
</telerik:RadScheduler>

 

...and this is the code behind

 

1.<p>  Private Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated</p><p> .............</p><p>            Dim chk2 As CheckBox = e.Container.FindControl("AllDayEvent")<br>            Dim chk1 As CheckBox = e.Container.FindControl("RecurrentAppointment")<br>            Dim chk3 As RadTimePicker = e.Container.FindControl("StartTime")<br>            Dim chk4 As RadTimePicker = e.Container.FindControl("EndTime")<br><br>            CType(e.Container.FindControl("AllDayEvent"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")<br>            CType(e.Container.FindControl("RecurrentAppointment"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")<br>            CType(e.Container.FindControl("StartTime"), RadTimePicker).Style.Add(HtmlTextWriterStyle.Visibility, "none")<br>            CType(e.Container.FindControl("EndTime"), RadTimePicker).Style.Add(HtmlTextWriterStyle.Visibility, "none")</p><p>...............</p><p>End Sub</p>

 

the code "CType(e.Container.FindControl("RecurrentAppointment"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")" returns me an error, in the ScriptResource.axd file (Object reference not set to an instance of an object)

the variable chk1 is "Nothing".

 

 Any idea how to solve the issue?

 

Thanks in advance

 

2 Answers, 1 is accepted

Sort by
0
Pasquale
Top achievements
Rank 1
answered on 09 Apr 2015, 10:31 AM

 [code]

            Dim chk2 As CheckBox = e.Container.FindControl("AllDayEvent")
            Dim chk1 As CheckBox = e.Container.FindControl("RecurrentAppointment")
            Dim chk3 As RadTimePicker = e.Container.FindControl("StartTime")
            Dim chk4 As RadTimePicker = e.Container.FindControl("EndTime")

            CType(e.Container.FindControl("AllDayEvent"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")
            CType(e.Container.FindControl("RecurrentAppointment"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")
            CType(e.Container.FindControl("StartTime"), RadTimePicker).Style.Add(HtmlTextWriterStyle.Visibility, "none")
            CType(e.Container.FindControl("EndTime"), RadTimePicker).Style.Add(HtmlTextWriterStyle.Visibility, "none")

[/code]

 

this is the formatted code... Sorry :)​

0
Plamen
Telerik team
answered on 10 Apr 2015, 07:29 AM
Hi,

I will recommend you to refer to this help topic where in the Make changes in the recurrence editor section is explained how to find controls in the RecurrenceEditor.

Regards,
Plamen
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Scheduler
Asked by
Pasquale
Top achievements
Rank 1
Answers by
Pasquale
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or