1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Next Button

4 posts, 1 answered
  1. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    11 Jul 2010
    Link to this post
    I'd like to create a next button that will take me to the next page in the list of pages as they display in the CMS.  Can you help me with that?

    Thank you very much in advance!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 Jul 2010
    Link to this post
    Hello Shawn Davis,

    It can you RadGrid with paging. You could take a look at this demo.

    All the best,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    12 Jul 2010
    Link to this post
    Thanks for your reply!  But sorry, I think my question wasn't clear enough.  I have a page in Sitefinity that has say 10 sub pages.  I'm on subpage one - I'd like to create a User control that has a button that will allow the user to move to the next (or previous) page in the list of subpages as they have been ordered by me in the CMS.

    Thanks again!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 Jul 2010
    Link to this post
    Hello Shawn Davis,

    You have to implement a property  where you save the selected value. You can use the ViewState or control LoadState. Then on each click you have to increment the value and depending on that you should select a page or open this page

    Below is a sample code

    protected void Page_Load(object sender, EventArgs e)
       {
          var manager = new CmsManager();
          var root = (ICmsPage)manager.GetPage(new Guid("9bd6c1bf-f65f-4cf7-bebd-d8220a55f6db"));
         
          if (root.Pages.Count > 0)
          {
              RadTreeView1.DataSource = root.Pages;
              RadTreeView1.NodeDataBound += new Telerik.Web.UI.RadTreeViewEventHandler(RadTreeView1_NodeDataBound);
              RadTreeView1.DataTextField = "Name";
              RadTreeView1.DataBind();
          }
     
          Button1.Click += new EventHandler(Button1_Click);
       }
     
       void RadTreeView1_NodeDataBound(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
       {
           if (e.Node.Index == (Increment -1))
           {
               e.Node.Selected = true;
           }
       }
     
       void Button1_Click(object sender, EventArgs e)
       {
          
           int i = 0;
           var inc = Increment + 1;
           Increment = inc;
           Response.Write(Increment.ToString());
       }
     
     
     
       public int Increment
       {
           get
           {
               var obj = this.ViewState["Increment"];
               if (obj != null)
                   return (int)obj;
               return 0;
           }
     
           set
           {
               this.ViewState["Increment"] = value;
           }
       }


    Regards,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
    Answered
Register for webinar
4 posts, 1 answered