I'm having problems getting self-referencing data to display in my RadTreeView. I'm using the Q1 2007 release in VS Team Suite SP1 on Vista 32bit.
I'm trying to bind the tree to a DataSet which holds the following Xml data:
<Toc>
<Node>
<Title>Main Title</Title>
<Target>d03.xml</Target>
<id>1</id>
<parentId>-1</parentId>
</Node>
<Node>
<Title>Child Title</Title>
<Target>d0300000.xml</Target>
<id>2</id>
<parentId>1</parentId>
</Node>
</Toc>
When using the Property Builder and selecting the DataSet as the DataSource, "Toc" as the DataMember, and Toc.Title as the DisplayMember then I get no items at all shown in the resulting WinForm.
When setting properties in code as below I get the title of the two nodes; however, no graphics or parent/child relationship are shown.
dataSet1 = new DataSet();
dataSet1.ReadXml("d03_toc.xml");
radTreeView1.DataSource = dataSet1;
radTreeView1.DataMember = "Toc";
radTreeView1.DisplayMember = "Toc.Title";
radTreeView1.ValueMember = "Toc.id";
radTreeView1.ParentIDMember = "Toc.parentId";
It's completely unclear in the help file if or how I'm supposed to use the Property Builder to create any nodes when using a bound data source. Is this part of my problem?
I'd certainly appreciate a pointer as to where I've gone wrong.
using
System;
using
System.Collections.Generic;
using
System.Windows.Forms;
namespace
Test
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
List<Data> list =
new
List<Data>();
list.Add(
new
Data() { Value =
"A"
});
list.Add(
new
Data() { Value =
"B"
});
list.Add(
new
Data() { Value =
"C"
});
radDropDownList1.ValueMember = radDropDownList1.DisplayMember =
"Value"
;
radDropDownList1.DataSource = bindingSource;
bindingSource.DataSource = list;
}
}
public
class
Data
{
public
string
Value {
get
;
set
; }
}
}