i want to access dropdownlist control which is inside radpageview of telerik control in my code behind file

StackOverflow https://stackoverflow.com/questions/22735403

  •  23-06-2023
  •  | 
  •  

Question

i am facing problem with telerik tab control.

i have two tabs which i have created using telerik tab control that is radtabstrip.

now i have one dropdownlist control which is inside radpageview of radmultipage.

now can any one provide me syntax of how to access drop downlist which is inside radpageview of

radmultipage???

i have tried this but facing error: radpageview1.drodownlist1.item.selecteditem;

Was it helpful?

Solution

You need to use FindControl() like with any other nested control (e.g., a Panel). Here is an example:

protected void Page_Load(object sender, EventArgs e)
{
    RadDropDownList rddl = RadPageView2.FindControl("RadDropDownList1") as RadDropDownList;
    rddl.Visible = false;
}

assuming your structure looks like this (whether it is generated from the code-behind is irrelevant, you only need to recreate it early enough):

        <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1">
            <Tabs>
                <telerik:RadTab Text="first"></telerik:RadTab>
                <telerik:RadTab Text="second"></telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage runat="server" ID="RadMultiPage1">
            <telerik:RadPageView ID="RadPageView1" runat="server" Width="100%">
                PageView
            </telerik:RadPageView>
            <telerik:RadPageView ID="RadPageView2" runat="server" Width="100%">
                <telerik:RadDropDownList runat="server" ID="RadDropDownList1"></telerik:RadDropDownList>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top