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

RadPageView remains hidden when tab has space in its name

9 Answers 188 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 28 Oct 2011, 08:03 AM

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.

9 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 31 Oct 2011, 01:39 AM
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>
0
Dimitar Terziev
Telerik team
answered on 02 Nov 2011, 07:46 AM
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
0
Jeff
Top achievements
Rank 1
answered on 03 Nov 2011, 06:30 PM
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.
0
John
Top achievements
Rank 1
answered on 17 Jan 2012, 04:11 PM
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);
0
Dimitar Terziev
Telerik team
answered on 20 Jan 2012, 03:13 PM
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
0
Kevin
Top achievements
Rank 1
answered on 03 Feb 2012, 08:04 PM
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

0
Lauro
Top achievements
Rank 1
answered on 08 Mar 2013, 12:17 PM
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);
0
Bryon
Top achievements
Rank 2
Iron
answered on 03 Dec 2015, 04:09 PM

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.

0
Ivan Danchev
Telerik team
answered on 07 Dec 2015, 05:41 PM
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
Tags
TabStrip
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Dimitar Terziev
Telerik team
John
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Lauro
Top achievements
Rank 1
Bryon
Top achievements
Rank 2
Iron
Ivan Danchev
Telerik team
Share this question
or