ParentID

3 posts, 0 answers
  1. Christopher Blickley
    Christopher Blickley avatar
    202 posts
    Member since:
    Jan 2004

    Posted 08 Mar 2012 Link to this post

    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. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 12 Mar 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Christopher Blickley
    Christopher Blickley avatar
    202 posts
    Member since:
    Jan 2004

    Posted 12 Mar 2012 Link to this post

    Perfect, thanks!
Back to Top