Hiding Appointment's Custom Attributes

2 posts, 0 answers
  1. Sergio
    Sergio avatar
    11 posts
    Member since:
    Feb 2009

    Posted 12 Sep 2011 Link to this post

    Dear Sirs,
    we are using latest version of RadScheduler in our web application and we need to hide some custom attributes which are shown in the appointment's edit form such as the EndDate Date/Time pickers, subject textbox and so on.
    In a previous version of tererik's library (maybe 2009) we used something like that on the FormCreated event:
    RadDatePicker startDate = (RadDatePicker)e.Container.FindControl("StartDate");
    RadDatePicker endDate = (RadDatePicker)e.Container.FindControl("EndDate");
    endDate.CssClass = "Hide";
    WebControl conEndTime = (WebControl)e.Container.FindControl("EndTime");
    conEndTime.CssClass = "Hide";
    RadTextBox subjectTextbox = (RadTextBox)e.Container.FindControl("Subject");
    subjectTextbox.CssClass = "Hide";
    RadTextBox tbxTicketId = (RadTextBox)e.Container.FindControl("AttrTicketId");
    tbxTicketId.CssClass = "Hide";
    tbxTicketId.LabelCssClass = "Hide";
    ................

    but now it doesn't work anymore, so how can we hide the controls in the appointment form?
    Many thanks in advance.
    Best Regards.
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 14 Sep 2011 Link to this post

    Hi Sergio,

    I tried the following code and css and it worked as expected.
    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
       {
           if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)
           {
               RadDatePicker startDate = (RadDatePicker)e.Container.FindControl("StartDate");
     
               RadDatePicker endDate = (RadDatePicker)e.Container.FindControl("EndDate");
     
               endDate.CssClass = "Hide";
     
               RadTimePicker conEndTime = (RadTimePicker)e.Container.FindControl("EndTime");
     
               conEndTime.CssClass = "Hide";
     
               RadTextBox subjectTextbox = (RadTextBox)e.Container.FindControl("Subject");
     
               subjectTextbox.CssClass = "Hide";
     
               RadTextBox tbxTicketId = (RadTextBox)e.Container.FindControl("AttrTicketId");
     
               tbxTicketId.CssClass = "Hide";
     
               tbxTicketId.LabelCssClass = "Hide";
           }
       }

    <style type="text/css">
      .Hide
      {
          visibility:hidden !important;
          height: 0px !important;
          }
      </style>


    Best wishes,
    Peter
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Back to Top