ObjectDataSource and TreeView

4 posts, 0 answers
  1. Joseph
    Joseph avatar
    135 posts
    Member since:
    Sep 2007

    Posted 02 Jun 2009 Link to this post

    I have the following DB view :

    ID   Language  DisplayLanguage
    1     Arabic       Saudi Arabia (ARA)
    2     Arabic        Egypt (ARE)
    3     English       English(US)
    4     English       English(BR)


    I want to represent this view in a treeView with Language as parent node and DisplayLanguage as child nodes.

    <

     

    telerik:RadTreeView ID="targetTreeView"

     

     

    TriStateCheckBoxes="true"

     

     

    CheckChildNodes="true"

     

     

    Skin="Web20"

     

     

    CheckBoxes="true"

     

     

    DataSourceID="odsLanguages"

     

     

    DataFieldID="ID"

     

     

    DataFieldParentID="Language"

     

     

    DataTextField="Language"

     

     

    runat="server">

     

     

    </telerik:RadTreeView>

    The combination DataFieldID, DataFieldParentID, DatatextField is not working.

    Any help please?

     

  2. Joseph
    Joseph avatar
    135 posts
    Member since:
    Sep 2007

    Posted 03 Jun 2009 Link to this post

    Any ideas guys?
  3. Joseph
    Joseph avatar
    135 posts
    Member since:
    Sep 2007

    Posted 03 Jun 2009 Link to this post

    I have added to the table a new column called ParentLanguageID so the Child and Parent are with the same type of IDs.

     

     

    DataFieldID="ID"

     

     

     

     

     

    DataFieldParentID="ParentLanguageID"

     

     

     

     

     

    DataTextField="DisplayLanguage"


    But I am getting the following error :

     

     

    This constraint cannot be enabled as not all values have corresponding parent values.

    Help!

  4. Joseph
    Joseph avatar
    135 posts
    Member since:
    Sep 2007

    Posted 03 Jun 2009 Link to this post

    Ok, I found another way.

    I used the on demand loading, very cool!
Back to Top