I have a treeview that is blowing up on loading in data. Here is what is happening.
Here is the data:
ParentID HierarchicalID VariableText
0 0 TEST
0 600 ONE
600 601 TWO
Why is the treeview throwing an error??????
dsVariables = GetDocVariables()
RadTreeView2.Nodes.Clear()
RadTreeView2.ParentIDMember =
"ParentID"
RadTreeView2.ValueMember =
"HierarchicalID"
RadTreeView2.DisplayMember =
"VariableText"
RadTreeView2.DataSource = dsVariables.Tables(0)
Here is the data:
ParentID HierarchicalID VariableText
0 0 TEST
0 600 ONE
600 601 TWO
Why is the treeview throwing an error??????
4 Answers, 1 is accepted
0
Accepted
Hello mike scardina,
There was an issue in the RadTreeView data binding functionality, that caused recursion in the tree view structure in your particular scenario. This issue is now addressed and will not appear in 2008 Q1 release.
For the time being, you can easily workaround this issue by setting the ParentID value for the root node to -1 instead of 0.
Regards,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
There was an issue in the RadTreeView data binding functionality, that caused recursion in the tree view structure in your particular scenario. This issue is now addressed and will not appear in 2008 Q1 release.
For the time being, you can easily workaround this issue by setting the ParentID value for the root node to -1 instead of 0.
Regards,
Jordan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Hello Mike,
Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.
Best wishes,
Stefan
the Telerik team
Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.
Best wishes,
Stefan
the Telerik team
0
Javier
Top achievements
Rank 1
answered on 16 Mar 2018, 05:54 PM
Hello! I am trying to upload a beam from a recursive table with the following fields:
ID; NAME; ID_FK; TYPE;
1; CARLOS NULL 0
2; PETER NULL 0
3; JHON 1 1
4; MARY 1 1
Now I would like it to be loaded according to the relationship, how could I do it?
0
Hello, Javier,
You can find below a sample code snippet demonstrating how to bind RadTreeView to self-reference data:
Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/treeview/data-binding/binding-to-self-referencing-data
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
You can find below a sample code snippet demonstrating how to bind RadTreeView to self-reference data:
DataTable dt =
new
DataTable();
dt.Columns.Add(
"ID"
,
typeof
(
int
));
dt.Columns.Add(
"NAME"
,
typeof
(
string
));
dt.Columns.Add(
"ID_FK"
,
typeof
(
int
));
dt.Columns.Add(
"TYPE"
,
typeof
(
int
));
dt.Rows.Add(1,
"CARLOS"
, 0, 0);
dt.Rows.Add(2,
"PETER"
, 0, 0);
dt.Rows.Add(3,
"JHON"
, 1, 1);
dt.Rows.Add(4,
"MARY"
, 1, 1);
this
.radTreeView1.DisplayMember =
"NAME"
;
this
.radTreeView1.ParentMember =
"ID_FK"
;
this
.radTreeView1.ChildMember =
"ID"
;
this
.radTreeView1.DataSource = dt;
Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/treeview/data-binding/binding-to-self-referencing-data
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.