RadTabStrip with RadMultiPage

4 posts, 0 answers
  1. Gromiko
    Gromiko avatar
    2 posts
    Member since:
    Aug 2011

    Posted 09 Aug 2011 Link to this post

    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
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 12 Aug 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gromiko
    Gromiko avatar
    2 posts
    Member since:
    Aug 2011

    Posted 12 Aug 2011 Link to this post

    HI Dimitar,
    Thanks for your reply.
    Yes it's a SharePoint Application.
    I'm using SharePoint 2010.

    Best Regards,
    Gromiko Francese
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 18 Aug 2011 Link to this post

    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.

Back to Top