Advanced Form Access controls within User Control

4 posts, 0 answers
  1. Nick
    Nick avatar
    11 posts
    Member since:
    Jan 2009

    Posted 15 May 2009 Link to this post

    This is probably a simple answer, and I'm just not seeing it.
    I'm using the Custom Advanced Form example, and what I would like to do is hide the Resource drop down list located within the user controls based on a value on my Scheduler page. For example, if lblOwner.text="N" on the scheduler page, then hide the resource drop down on the advanced form when editing or creating an appointment.

    How would I go about accessing those controls?
  2. Yana
    Admin
    Yana avatar
    4850 posts

    Posted 18 May 2009 Link to this post

    Hello Nick,

    I suggest you use OnFormCreated event to determine which controls to show. You can use e.Container.FindControl method to find the control.

    All the best,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. David
    David avatar
    26 posts
    Member since:
    Aug 2012

    Posted 29 Aug 2012 Link to this post

    I've found that e.Container.FindControl doesn't work for finding AdvancedForm controls when using the custom AdvancedForm. Like for instance, if my resource is named ResRoom, the RadComboBox ID is generated ResRoom_ResourceValue.

    e.Container.ClientID doesn't build out the actual ID that would reference FindControl either. Any suggestions?
  4. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2035 posts

    Posted 03 Sep 2012 Link to this post

    Hello Nick,

    This is behavior is expected. You may inspect with the debugger,  set a watch for e.Container and check what exactly is returned and kept within this variable. You may find below a code, that demonstrates hiding the reminders drop-down field from the advanced form. You can use our demo here and apply this code to see how that works.

    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        RadComboBox reminder = (RadComboBox)e.Container.Controls[1].FindControl("ReminderDropDown");
        reminder.Visible = false;
    }

    Hope this will be helpful.

    Kind regards,
    Boyan Dimitrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top