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

3 posts, 0 answers
  1. Pasquale
    Pasquale avatar
    2 posts
    Member since:
    Apr 2013

    Posted 09 Apr 2015 Link to this post

    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. Pasquale
    Pasquale avatar
    2 posts
    Member since:
    Apr 2013

    Posted 09 Apr 2015 in reply to Pasquale Link to this post

     [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 :)​

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 10 Apr 2015 Link to this post

    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.

     
Back to Top