How to reproduce:
DataTable table = new DataTable();
table.Columns.Add("ParentId", typeof(int));
table.Columns.Add("ChildId", typeof(int));
table.Columns.Add("ProductId", typeof(int));
table.Columns.Add("ProductCode", typeof(string));
table.Rows.Add(0, 1, 3, "Pr - 01");
table.Rows.Add(1, 2, 4, "P r- 02");
table.Rows.Add(1, 3, 5, "Pr - 03");
this.radTreeView1.DisplayMember = "ProductCode";
this.radTreeView1.ParentMember = "ParentId";
this.radTreeView1.ChildMember = "ChildId";
this.radTreeView1.ValueMember = "ProductId";
this.radTreeView1.DataSource = table;
Hello,
Workaround: Create a custom node and override its OnDataBoundItemChanged method:
private void RadForm1_Load(object sender, EventArgs e)
{
this.RadTreeView1.CreateNode += RadTreeView1_CreateNode;
// Bind the tree
}
private void RadTreeView1_CreateNode(object sender, CreateTreeNodeEventArgs e)
{
e.Node = new MyRadTreeNode();
}
public class MyRadTreeNode : RadTreeNode
{
protected override void OnDataBoundItemChanged(object oldItem, object newItem)
{
base.OnDataBoundItemChanged(oldItem, newItem);
// Be notified when setting the data-bound item
}
}
Regards,
Hristo
Progress Telerik