treeview not visible on first load

5 posts, 0 answers
  1. Vandara Peou
    Vandara Peou avatar
    20 posts
    Member since:
    Apr 2006

    Posted 24 Mar 2009 Link to this post

    Hi,

    I'm having a wierd issue with databinding my treeview control on page_init event. Basically on the first load of the control it's not visible--non of its nodes are rendedered. Any subsequent requests to the same page though and the control appears and functions normally. This isn't a problem when loading the control on page_load although i need to do it in page_init for page life cycle and viewstate reasons.

    Any insight into this?

    Thanks,
    Vandara Peou
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Mar 2009 Link to this post

    Hi Vandara Peou,

    Unfortunately the provided information does not indicate the reason for the problem. RadTreeView should work as expected when populated during Page_Init. Could you verify that the treeview is not empty the first time - Nodes.Count should be greater than zero.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vandara Peou
    Vandara Peou avatar
    20 posts
    Member since:
    Apr 2006

    Posted 25 Mar 2009 Link to this post

    Hi,

    The node code is greater than zero when I step through the code in Page_Init, but once i hit Page_Load or Page_PreRender and I check the node code it becomes zero. This only happens on the very first page load. On every subsequent load everything works as intended. There is no other code affecting the treeview.

    The tree view is declared as follows:

    <

    telerik:RadTreeView ID="rtvLocations" Runat="server" Height="350px" Width="286px" CheckBoxes="True" Skin="Default"></telerik:RadTreeView>

    And the code to load it is as follows:

     

     

    With rtvLocations

     

    .DataSource = dtDestinations

    .DataValueField =

    "LocationID"

     

     

     

    .DataTextField =

    "LocationDisplay_Name"

     

     

     

    .DataFieldID =

    "LocationID"

     

     

     

    .DataFieldParentID =

    "ParentID"

     

     

     

    .DataBind()

     

    End With

     

  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Mar 2009 Link to this post

    Hello Vandara Peou,

    This means that something is clearing the nodes between the Init and Render stage. We cannot tell why this happens unless we see a running project which demonstrates your problem. I suggest you open a support ticket and send us your page as attachment.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Vandara Peou
    Vandara Peou avatar
    20 posts
    Member since:
    Apr 2006

    Posted 25 Mar 2009 Link to this post

    I was able to fix the problem. I simply did a load on both Page_Init and Page_Load with the one on page load checking to see if it has any nodes first.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017