How to select the RadTab for a RadPageView that has a specific control

2 posts, 0 answers
  1. Paul
    Paul avatar
    1 posts
    Member since:
    Jul 2013

    Posted 13 Nov 2013 Link to this post

    I am trying to implement a solution on a website where some pages have a RadTabStrip (with the MultiPageID set) with multiple tabs (with the PageViewID set).

    When navigating to a page you can set the focus be set to a specific control that may be in a RadPageView.  If that is the case what is the best way to select the tab that corresponds to the page view that contains the control?

    Basically when focus is set to a control in a RadPageView how do I make sure the rad tab is selected so that control can be seen on the page?

    I can find the control on the page that needs focus and then find the parent RadPageView (and RadMultiPage), but I don't know of a good way to select the RadTab that corresponds to the RadPageView (since I don't know the ID of the RadTabStrip). 

    Am I forced to recursively search through the controls on to the page to find the RadTabStrip (by type) and then find the tab that has the matching PageViewID?


  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    1728 posts

    Posted 18 Nov 2013 Link to this post


    Regarding the custom scenario you attempt to implement and the fact that the ID of the RadTabStrip is not know, I suggest that the approach you attempted to implement is the appropriate one - finding the RadTabStrip on the page by its type.

     However, as a slight facility, I would suggest you to use a custom attribute for each PageView, with setting a value associated with the corresponding Tab. Thus, once you find the needed control and the PageView, where it is nested in, you could store the value (suggesting the TabName, which the pageView is associated with) of the custom attribute. Once you find the RadTabStrip on the Page, you could directly use the Selected property of the RadTab, in order to focus it.

    <telerik:RadTabStrip ID="rtsNavigation" runat="server"
                        MultiPageID="rmpMainContent" SelectedIndex="0">
                            <telerik:RadTab runat="server" Text="Tab1">
                            <telerik:RadTab runat="server" Text="Tab2">
                    <telerik:RadMultiPage ID="rmpMainContent" runat="server" >
                        <telerik:RadPageView ID="rpvMainPage1" runat="server" CustomAttribute="Tab1"
                        <telerik:RadPageView ID="rpvMainPage3" runat="server" CustomAttribute="Tab2"

    Boyan Dimitrov
    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top