This is a migrated thread and some comments may be shown as answers.

hierarchal tree view

5 Answers 90 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Moustafa
Top achievements
Rank 1
Moustafa asked on 09 Oct 2008, 07:28 AM
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.

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 09 Oct 2008, 07:50 AM
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.
0
Moustafa
Top achievements
Rank 1
answered on 09 Oct 2008, 07:53 AM
I'm using the Ra Controls for asp.net ajax version 2008 Q2

so I think it is the last one
0
Atanas Korchev
Telerik team
answered on 09 Oct 2008, 08:01 AM
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.
0
Moustafa
Top achievements
Rank 1
answered on 09 Oct 2008, 08:09 AM
this is my   assembly version
2008.02.0723.35

if not support building hierarcial 

please send me the dowload link for the last version
0
Atanas Korchev
Telerik team
answered on 09 Oct 2008, 08:11 AM
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.
Tags
TreeView
Asked by
Moustafa
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Moustafa
Top achievements
Rank 1
Share this question
or