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

Advanced Form Access controls within User Control

3 Answers 74 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 15 May 2009, 08:07 PM
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?

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 May 2009, 07:58 AM
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.
0
David
Top achievements
Rank 1
answered on 29 Aug 2012, 11:58 AM
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?
0
Boyan Dimitrov
Telerik team
answered on 03 Sep 2012, 02:59 PM
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.
Tags
Scheduler
Asked by
Nick
Top achievements
Rank 1
Answers by
Yana
Telerik team
David
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or