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

AdvancedEditForm Controls - Accessing

1 Answer 5 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Lisa
Top achievements
Rank 1
Lisa asked on 07 Nov 2018, 09:55 PM

Depending on the type of appointment, I would like to set enable=false for the basiccontrolspanel and the advancedcontrolspane and leave the ButtonsPanel enabled on the AdvancedEdit form.  I am able to use .FindControl to get to ButtonsPanel, but the other panels I am cannot.  I get "System.NullReferenceException: 'Object reference not set to an instance of an object.'  I need the user to be able to view the AdvancedEdit, so I cannot set AllowEdits=False.  Doing this will not allow the user to open the form.  Any suggestions aside from finding each control (Subject, StartDate, EndDate, AllDayEvent, etc.) and setting them each to Enabled=false.  I am using UI for ASP.NET AJAX, Version 2018.3.910.45.   

Thank you for your help.

Lisa

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 12 Nov 2018, 10:09 AM
Hello Lisa,

Unfortunately, the panel containing the other controls does not have an ID specified. 

Nevertheless, you can access it by accessing the parent control of the ButtonsPanel and access the first control of the controls' collection: 

Panel buttons = e.Container.FindControl("ButtonsPanel") as Panel;
buttons.Enabled = false;
 
Panel advanced = buttons.Parent.Controls[0] as Panel;
advanced.Enabled = false;

Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Scheduler
Asked by
Lisa
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or