I have a RadScheduler where I use the AdvancedInsertTemplate and AdvancedEditTemplate.
In the AdvancedForm user control I want to show different controls depending on the logged in user is Administrator or a normal user. So I've added a LoginView like this:
<
asp:Panel
runat
=
"server"
ID
=
"AdvancedControlsPanel"
CssClass
=
"rsAdvMoreControls"
>
<asp:Panel
runat
=
"server"
>
<%-- RESOURCE CONTROLS --%>
<
ul
class
=
"rsResourceControls"
>
<
li
>
<
asp:LoginView
ID
=
"LoginView1"
runat
=
"server"
>
<
RoleGroups
>
<
asp:RoleGroup
Roles
=
"Administrator"
>
<
ContentTemplate
>
<!-- Resource controls should follow the convention Res[Resource Name] for ID -->
<
scheduler:ResourceControl
runat
=
"server"
ID
=
"ResCustomer"
Type
=
"Customer"
Label
=
"Customer: "
Skin='<%# Owner.Skin %>' />
<
telerik:RadComboBox
runat
=
"server"
ID
=
"EmployeeComboBox"
Label
=
"Employee: "
Visible
=
"true"
Skin
=
"Outlook"
Width
=
"300px"
CausesValidation
=
"false"
OnClientSelectedIndexChanged
=
"OnClientSelectedIndexChanged"
OnClientLoad
=
"employeeClientLoad"
>
</
telerik:RadComboBox
>
</
ContentTemplate
>
</
asp:RoleGroup
>
<
asp:RoleGroup
Roles
=
"User"
>
<
ContentTemplate
>
<
asp:Label
ID
=
"LabelCustomer"
runat
=
"server"
Text
=
"CustomerName"
/>
</
ContentTemplate
>
</
asp:RoleGroup
>
</
RoleGroups
>
</
asp:LoginView
>
...
When compiling I then get an error saying "ResCustomer does not exist in current context":
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public object Customer
{
get
{
return ResCustomer.Value;
}
set
{
ResCustomer.Value = value;
}
}
I then try to access the controls within the LoginView, but I can't find them:
LoginView lv = FindControl("LoginView1") as LoginView;
RadComboBox employeeComboBox = lv.FindControl("EmployeeComboBox") as RadComboBox;
Label customerLabel = lv.FindControl("LabelCustomer") as Label;
But now both the employeeComboBox and the customerLabel are null? The LoginView1 has been found, though.
And how do I find the ResCustomer?
On the page where the RadScheduler is I have a similar scenario, and there the controls within the LoginView are found without any problem.
What am I missing?
Regards, Jill-Connie Lorentsen