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

ParentID

2 Answers 63 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 08 Mar 2012, 08:22 PM
Hello:

Two quick questions.  Do the DataFieldID and DataFieldParentID have to be numeric (like an integer data type)?  It doesn't seem to work if I have those fields as strings.  I'm trying to generate an org chart, using a string-based employee ID, but it comes up blank.

Second, to make it work, I converted the ID to an integer for the two fields.  It then works fine, but I noticed that I have to set the "root" item to have a "0" for the parent field.  Is this expected?  As an example, I want to generate an Org with me at the top.  In the dataset, the row that represents me has a parent employee ID, but that employee ID is not present in the data since I don't want my supervisor displayed.  In order to get the chart to render, I have to look through the records and ensure that my record as "0" for the parent.

Perhaps this second issue is related to the first.  If a string is in fact supported, does the top level item need to have the parent field set to a particular value?  Perhaps an empty string?

Thanks,
Chris

2 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 12 Mar 2012, 11:57 AM
Hi Chris,

It is not a problem if the ParentID is string. The problem is that the first node in the hierarchy shouldn't have a ParentID - it should be null. If the ParentID of the first node is set, it means that it has a parent. So, it leads to an empty hierarchy.

All the best,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Christopher
Top achievements
Rank 1
answered on 12 Mar 2012, 04:34 PM
Perfect, thanks!
Tags
OrgChart
Asked by
Christopher
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Christopher
Top achievements
Rank 1
Share this question
or