AdvancedEditForm Controls - Accessing

2 posts, 0 answers
  1. Lisa
    Lisa avatar
    1 posts
    Member since:
    Apr 2018

    Posted 07 Nov 2018 Link to this post

    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.


  2. Peter Milchev
    Peter Milchev avatar
    804 posts

    Posted 12 Nov 2018 Link to this post

    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;

    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.
Back to Top