RadPageView remains hidden when tab has space in its name

10 posts, 0 answers
  1. Jeff
    Jeff avatar
    3 posts
    Member since:
    Aug 2011

    Posted 28 Oct 2011 Link to this post


    I have a RadTabStrip paired with a RadMultiPage.  The RadPageViews are created dynamically in the OnDataBinding event of the RadTabStrip.  Everything is working fine except when the tabs have spaces (or other special characters) in their titles.  When I click on those particular tabs, I examined the rendered html for the RadMultiPage -- what happens is that the "class=rmpHiddenView" is not removed from the div representing the page view (at this point the other tabs have this CSS class applied plus the inline style "display:none").  When I click on the tabs without spaces in their names, everything works -- that class is removed (and the inline style "display:none" is also removed).

    This is the markup:
    <telrik:RadTabStrip runat="server" ID="uiTabs" DataSource="<%#this.RetrieveSubpageData()%>"
        OnDataBinding="uiTabs_OnDataBinding" MultiPageID="uiPages"
        SelectedIndex="0" DataTextField="PageTitle">
    </telrik:RadTabStrip>
    <telrik:RadMultiPage runat="server" ID="uiPages" SelectedIndex="0">
    </telrik:RadMultiPage>

    Here is what the rendered html looks like after I click on the third tab:

    Note that in this picture, I'm URL encoding the id of the RADPageView when I set it in my codebehind, but I get the same result when I don't URL encode it.
  2. Jeff
    Jeff avatar
    3 posts
    Member since:
    Aug 2011

    Posted 30 Oct 2011 Link to this post

    Further information:

    Even if I substitute my own script to "select" the page, I get the same results (it works except for tabs that have spaces in their title).  Suggesting, perhaps that the problem is with the RadMultiPage "set_selected" script itself, perhaps?

    Here is the code I used for selection, to be specific:
    <script type="text/javascript">
        function selectPageView(sender, args) {
            var pageView = $find("<%= uiPages.ClientID %>");
            var selectedTab = args.get_tab();
            var pageViewIndex = selectedTab.get_index();
     
            var selectedPageView = pageView.get_pageViews().getPageView(pageViewIndex);
            selectedPageView.set_selected(true);
            selectedPageView.show();
     
            return false;
        }
    </script>
    <telrik:RadTabStrip runat="server" ID="uiTabs" DataSource="<%#this.RetrieveSubpageData()%>"
        OnDataBinding="uiTabs_OnDataBinding" OnClientTabSelected="selectPageView"
        SelectedIndex="0" DataTextField="PageTitle" DataValueField="PageUrl">
    </telrik:RadTabStrip>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 02 Nov 2011 Link to this post

    Hi Jeff,

    Could you specify the exact version of the controls that you are using? Also please provide the server-side code that you are using to add pageview so I could try to reproduce the problem locally,

    Greetings,
    Dimitar Terziev
    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
  5. Jeff
    Jeff avatar
    3 posts
    Member since:
    Aug 2011

    Posted 03 Nov 2011 Link to this post

    No, it would be too complicated to try to run it locally.

    I found that the problem has something to do with how I was assigning the IDs.  Once I removed the codebehind that was setting the IDs on the tabs and pages, it worked.
  6. John
    John avatar
    2 posts
    Member since:
    Dec 2010

    Posted 17 Jan 2012 Link to this post

    Had exactly the same issue when upgrading to Telerik.Web.UI v.2011.3.1305.40
    This code worked on the older version of Telerik;
    tabName contained spaces for some tabs and these wouldn't display their contents
    RadTab tab = new RadTab();
    tab.Text = tabName;
    reportCategoryTabStrip.Tabs.Add(tab);
       
    RadPageView pageView = new RadPageView();
    pageView.ID = tabName;
    reportCategoryMultiPage.PageViews.Add(pageView);
    using below corrected the display issue;
       
    RadTab tab = new RadTab();
    tab.Text = tabName;
    reportCategoryTabStrip.Tabs.Add(tab);
    RadPageView pageView = new RadPageView();
    pageView.ID = tabName.Replace(" ", "");
    reportCategoryMultiPage.PageViews.Add(pageView);
  7. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 20 Jan 2012 Link to this post

    Hi John,

    I've made a very simple page trying to reproduce the experienced behavior, but to no avail. The version I'm using is 2011.3.1305. Pleas find it attached so you could test it on your side.

    Kind regards,
    Dimitar Terziev
    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
  8. Kevin
    Kevin avatar
    8 posts
    Member since:
    Feb 2012

    Posted 03 Feb 2012 Link to this post

    Just to add...

    I downloaded Telerik controls yesterday to try them out and I found the exact same thing.

    It took me quite a long time to figure out this was the problem.  For testing/reproduction purposes, I removed the spaces from any tab names (Changed "Tab 1" to "Tab1") and it worked perfectly. Thats how I figured out it was the spaces causing the problems.  (If I add a space to a previously working tab name, it then fails as well)

    Thankfully someone posted a work around.

    Kevin

  9. Lauro
    Lauro avatar
    1 posts
    Member since:
    Aug 2011

    Posted 08 Mar 2013 Link to this post

    Not only spaces. Any special character.

    In case you want to replace all special characters by any other string, use this:

    pageViewId = Regex.Replace(pageViewId, "[^a-zA-Z0-9 ]", StringToBeTheTransformatioin);
  10. Bryon
    Bryon avatar
    1 posts
    Member since:
    Mar 2015

    Posted 03 Dec 2015 Link to this post

    I just recently had the exact same problem, and to fix it, I set the RadPageView.Selected = true; associated with the RadTab that was selected also in my C# Codebehind.

                        RadTab RadTab1 = RadTabStrip1.Tabs.FindTabByValue("RadTab1Value");
                        RadTab1.Selected = true;
                        RadPageView1.Selected = true;

     

    That got rid of the rmpHiddenView CSSClass associated with the hidden content.

  11. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 07 Dec 2015 Link to this post

    Hello,

    This does not sound like the previously discussed issue related to having empty spaces and special characters in the Tab's Text and PageView's ID. The rmpHiddenView  class is set to all PageViews that are not selected and therefor not visible. So if you have 5 PageView's associated with 5 tabs only the selected PageView out of the 5 will not have this class set. As you have noticed the Tab selection and the PageView selection are separate so you can have a PageView different from the one associated with the Tab selected from code-behind.

    Regards,
    Ivan Danchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017