radtreeview not bind

5 posts, 0 answers
  1. niloofar
    niloofar avatar
    58 posts
    Member since:
    Aug 2010

    Posted 14 Sep 2010 Link to this post

    hi
    i used this url :http://mono.telerik.com/TreeView/Examples/Programming/DataBinding/DefaultCS.aspx
    tvActionsTreeView.DataTextField = "Text";
                    RAdtreeview1.DataNavigateUrlField = "Url";
                    RAdtreeview1.DataFieldID = "ID";
                    RAdtreeview1.DataFieldParentID = "ParentID";
                    RAdtreeview1.DataSource = CDSStockLogic.BusinessObjects.UI.Actions.GetAll();
                    RAdtreeview1.DataBind();
    RAdtreeview1.DataSource is full
    my data:
    ID             Url                  ParentID              Text
    ----------------------------------------------------------------
    0            null                 -1                          text1
    1            null                   0                         text2
    2           null                    0                         text3
    3            null                   1                         text4
    4            null                   1                         text5

    but radtreeview not bind and is empty
    please help
  2. niloofar
    niloofar avatar
    58 posts
    Member since:
    Aug 2010

    Posted 14 Sep 2010 Link to this post

    please help
  3. niloofar
    niloofar avatar
    58 posts
    Member since:
    Aug 2010

    Posted 15 Sep 2010 Link to this post

    i need to your help
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2817 posts

    Posted 16 Sep 2010 Link to this post

    Hi,

    Try changing the ParentID of the root node to 0 instead of -1. The node IDs should start from 1 to match. The TreeView should now be able to pick-up the hierarchy.

    I hope this helps.

    Best wishes,
    Tsvetomir Tsonev
    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
  5. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 16 Sep 2010 Link to this post

    Or allow your ParentID field to accept nulls and set -1 to null. That way it knows there is no parent for item with ID 0. That's how I create self-referencing tables.

    I hope that helps.
Back to Top