hierarchal tree view

6 posts, 0 answers
  1. Moustafa
    Moustafa avatar
    70 posts
    Member since:
    Jul 2008

    Posted 09 Oct 2008 Link to this post

    really I tryed several times to create hierarcial tree using the following properties

    • DataFiledID
    • DataFieldParentID

     but fails

    here is the sample code

    class
    SiteDataItem
    {
    private string _text;

     

     

    private string _url;

     

     

    private int _id;

     

     

    private int? _parentId;

     

     

    public string Text

     

    {

     

    get { return _text; }

     

     

    set { _text = value; }

     

    }

     

    public string Url

     

    {

     

    get { return _url; }

     

     

    set { _url = value; }

     

    }

     

    public int ID

     

    {

     

    get { return _id; }

     

     

    set { _id = value; }

     

    }

     

    public int? ParentID

     

    {

     

    get { return _parentId; }

     

     

    set { _parentId = value; }

     

    }

     

    public SiteDataItem(int id, int? parentId, string text, string url)

     

    {

    _id = id;

    _parentId = parentId;

    _text = text;

    _url = url;

    }

    }

     

     

     

     

    protected void Page_Load(object sender, EventArgs e)

     

    {

     

    List

    <SiteDataItem> siteData = new List<SiteDataItem>();

     

    siteData.Add(

    new SiteDataItem(1, null, "All Sites", ""));

     

    siteData.Add(

    new SiteDataItem(2, 1, "Search Engines", ""));

     

    siteData.Add(

    new SiteDataItem(3, 1, "News Sites", ""));

     

    siteData.Add(

    new SiteDataItem(4, 2, "Yahoo", "http://www.yahoo.com"));

     

    siteData.Add(

    new SiteDataItem(5, 2, "MSN", "http://www.msn.com"));

     

    siteData.Add(

    new SiteDataItem(6, 2, "Google", "http://www.google.com"));

     

    siteData.Add(

    new SiteDataItem(7, 3, "CNN", "http://www.cnn.com"));

     

    siteData.Add(

    new SiteDataItem(8, 3, "BBC", "http://www.bbc.co.uk"));

     

    siteData.Add(

    new SiteDataItem(9, 3, "FOX", "http://www.foxnews.com"));

     

    RadTreeView1.DataTextField =

    "Text";

     

    RadTreeView1.DataNavigateUrlField =

    "Url";

     

    RadTreeView1.DataFieldID =

    "ID";

     

    RadTreeView1.DataFieldParentID =

    "ParentID";

     

    RadTreeView1.DataSource = siteData;

    RadTreeView1.DataBind();

    }

    here is the output:

    Note:

    • I'm using Rad controls for asp.net ajax.
    • the sample code copied from the online example.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Oct 2008 Link to this post

    Hi Moustafa,

    You are probably using an older version of RadTreeView. Please make sure you are using the official one.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Moustafa
    Moustafa avatar
    70 posts
    Member since:
    Jul 2008

    Posted 09 Oct 2008 Link to this post

    I'm using the Ra Controls for asp.net ajax version 2008 Q2

    so I think it is the last one
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Oct 2008 Link to this post

    Hi Moustafa,

    The latest version is Q2 2008 SP2. The assembly version is 2008.2.1001.20/2008.2.1001.35.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Moustafa
    Moustafa avatar
    70 posts
    Member since:
    Jul 2008

    Posted 09 Oct 2008 Link to this post

    this is my   assembly version
    2008.02.0723.35

    if not support building hierarcial 

    please send me the dowload link for the last version
  6. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Oct 2008 Link to this post

    Hi Moustafa,

    You should log in your Client.net account in order to download any updated versions.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top