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

RadTabStrip with RadMultiPage

3 Answers 108 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Gromiko
Top achievements
Rank 1
Gromiko asked on 09 Aug 2011, 12:04 PM
Hi Telerik Team,

I am developing a webpart using RadTabStrip structure associated to a RadMultipage that can contain three RadPageViews.
Every single RadPageView has
a set of controls grouped in a single custom class.
This
structure is displayed properly on the page, but when I save data to use them in the next page, I try to access the controls in each of these pageviews but I don't find them.
In fact,
the call PageView.Controls [index] gives the following error: 'SystemArgumentException index was out of range'.
Also when I perform a FindControl ("MyCustomControl") on every single multipage or on PageView for direct research of my custom control I receive as output 'null'. Now  I attach my code.

ASPX
 <div class="el-tabview-strip">
       <rad:RadTabStrip ID="RadTabStrip1" runat="server" Orientation="VerticalLeft" SelectedIndex="0" MultiPageID="RadMultiPage1"></rad:RadTabStrip>
 </div>
 <div class="el-tabview-content">
        <div>
            <rad:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Height="416px" ></rad:RadMultiPage>
        </div>
 </div>


ASPX.CS

 
protected void Page_Load(object sender, EventArgs e)
{
   if (!IsPostBack)
      {
       List<String> aac = GetState();
       foreach (String cc in aac)
              {
               //Adding View to MultiPage
               Telerik.Web.UI.RadPageView view = new Telerik.Web.UI.RadPageView();
                    view.ID = ClientID + "radPageView" + cc.NumeroCC;
                    CustomControls MyCustomControl = new CustomControls();
                    MyCustomControl.ID = ClientID + "customContol" + cc.NumeroCC;
                    view.Controls.Add(MyCustomControl);
                    RadMultiPage1.PageViews.Add(view);
                    //Adding Tab to RAdstrip
                    Telerik.Web.UI.RadTab tab = new Telerik.Web.UI.RadTab();
                    tab.Text = "C/C " + cc.NumeroCC.Replace("/", " / ");
                    tab.CssClass = "tabsTab paddingTop17";
                    tab.SelectedCssClass = "tabsTab tabsTabSelected paddingTop17";
                    tab.PageViewID = ClientID + "radPageView" + cc.NumeroCC;
                    RadTabStrip1.Tabs.Add(tab);
                }
            }
        }
 public override void SaveNavigationState(Core.NavigationEventArgs e)
        {
            List<String> list = new List<String>();
            String aac = new String();
            for (int i = 0; i < RadMultiPage1.Controls.Count; i++)
            {
                Telerik.Web.UI.RadPageView pageView = RadMultiPage1.Controls[i] as Telerik.Web.UI.RadPageView;
                CustomControls current = pageView.Controls[i] as CustomControls;
                if (current == null)
                    return;
                aac = current.GetControl(); //This Method Return the value of all control grouped in the CustomControl
                list.Add(aac);
            }
    }

I hope you can help me.
Best regards,
Gromiko Francese

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 12 Aug 2011, 02:40 PM
Hi Gromiko,

The code that you are using seems right. Could you clarify whether this is a SharePoint application and if so which version of SharePoint you are using?

Kind regards,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Gromiko
Top achievements
Rank 1
answered on 12 Aug 2011, 03:08 PM
HI Dimitar,
Thanks for your reply.
Yes it's a SharePoint Application.
I'm using SharePoint 2010.

Best Regards,
Gromiko Francese
0
Kalina
Telerik team
answered on 18 Aug 2011, 05:05 PM
Hello Gromiko,

Thank you for the additional details provided.
However I doubt that the issue is SharePoint related because I succeeded to reproduce it with a simple ASP.NET page.

I inspected your code and I will suggest you add the custom control at PageViewCreated event handler.
Please find more details about this approach at the sample page provided. It is a very basic implementation but I believe it will help you resolve the issue.



All the best,
Kalina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
TabStrip
Asked by
Gromiko
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Gromiko
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or