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

Hiding Appointment's Custom Attributes

1 Answer 52 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sergio
Top achievements
Rank 1
Sergio asked on 12 Sep 2011, 04:24 PM
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.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 14 Sep 2011, 09:40 AM
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
Tags
Scheduler
Asked by
Sergio
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or