New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Hide or disable the editing of certain custom attributes in the advanced form

HOW-TO

Hide or disable the editing of certain custom attributes in the advanced form

SOLUTION

We can hide the attribute text fields (and labels) by handling the FormCreated event. For example, if you want to hide an attribute named "Annotations" the code will look like this:

protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)       
{       
    if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)       
    {       
        TextBox attributeTextBox = (TextBox) e.Container.FindControl("Attr" + /* Attribute name */ "Annotations");       
        WebControl attributeLabel = (WebControl) e.Container.FindControl("LblAttr" + "Annotations");       

        attributeTextBox.Visible = false;       
        attributeLabel.Visible = false;       
    }       
}       
In this article