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

Forums / Sitefinity SDK / TreeView UserCtrl in SF RC 4.0

TreeView UserCtrl in SF RC 4.0

8 posts, 0 answered
  1. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    03 Dec 2010
    Link to this post
    HI,

         I'm using a tree view control in a user control. When I drag the User Control to my SiteFinity page it gives the error below :

    Exception of type : System.Web.HttpUnhandledException was thrown.

    BUT WHen I Preview the page the Tree View Control appears in the screen just fine.

    Is there a way to remedy the error above so the TreeView appears in the screen on the SiteFinity page instead of the  error message?

    By the way there is no code for this. Its just a Tree View with one node. So the error is not code related.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Dec 2010
    Link to this post
    Hi Jon,

    Can you paste the control you use?

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    06 Dec 2010
    Link to this post
    Hi Ivan,

         Once again, I have a TreeView control on a User Control. When I go to 'Pages' in SiteFinity and select my page, drag the registered User Control to a page it gives me an error on the control. However, when I preview the page it self the Tree View shows up fine. I think there is a problem with multiple script managers on the SIteFinity page. My TreeView has a scriptmanager as well. If I take away the script manager and use Sitefintys script manager the tree will not display properly on the page in design view. I hope I"m making sense.

      Is there a way to have my tree view have a script manager and display properly in the page in Sitefinity ?
  4. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    06 Dec 2010
    Link to this post
    Can you paste the control you use ?

    Yes, I'm pasting the code for the tree view control onto the User Control. I'm not dragging the control. My previous post talks about script managers. Its a problem with SiteFinitys script managers. Please see my post.

    Thanks
    jon\
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Dec 2010
    Link to this post
    Hi Jon,

    In your first post you did not indicate that you have a script manager on the page. This is why asked for the control. Of course in ASP.NET you cannot have two ScriptManager controls on the same page.
    The ScriptManager is automatically injected on built-in templates and templates created with the template designer within Sitefinity 4.0. If you are using master pages for base of your templates you need to add the ScriptManager control in the markup. We add ASP.NET ScriptManager control on the page if you have not declared it in the control or your template.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    06 Dec 2010
    Link to this post

    Hi Ivan,

           I understand all of the above however, if I leave a script manager control out of my page the tree will not display properly. This is how to repeat the problem:

    1. Create a user control
    2. Add tree view to user control ( must have child items in tree view ) with no script manager
    3. register control in SiteFinity
    4. drag user control to a Sitefintiy page.

    The children items in the Tree View will not display. Just the text of the root node is displayed. Is there a way to fix this problem ?

    This is my code in my user control .. simple

    <telerik:RadTreeView ID="RadTreeView1" Runat="server"></telerik:RadTreeView>
      
      
      
                RadTreeView1.Nodes.Add(new RadTreeNode("Testing"));
                RadTreeNode rad1 = new RadTreeNode("TestTree");
                rad1.Nodes.Add(new RadTreeNode("1"));
                rad1.Nodes.Add(new RadTreeNode("2"));
                RadTreeView1.Nodes.Add(rad1);

  7. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    06 Dec 2010
    Link to this post
    HI Ivan,

              I have figured it out. When you drag your user control which contains a tree view to a SiteFinity page you have to manually refresh the page for the Tree View to display properly. You should not have to do this and I'm guessing theres no work around for this ...

    jon
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    07 Dec 2010
    Link to this post
    Hi Jon,

    I created the same control as you pasted and the RadTreeView renders correctly. Again, I cannot see any issues with the control or the way that it is rendered on the page.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
8 posts, 0 answered