These columns don't currently have unique values

5 posts, 0 answers
  1. Bill
    Bill avatar
    5 posts
    Member since:
    Mar 2009

    Posted 25 May 2009 Link to this post

    Hi, I just recently came across the following error "These columns don't currently have unique values"

    After troubleshooting I came across the problem but I still do not know of a solution. I will describe the problem
    in further detailing including my troubleshooting steps.

    The problem with the above error seems to be related to multiple child items which each belongs to
    different parent nodes.

    After going through testing the store procedure and rerunning the application, I modified the stored procedure and discovered that if I returned several child items with the same id regardless if it belongs to a separate parent then the above error will occur.

    For example:

    ParentID    ID        Name

    null            1        "John"
    null            2         "Ben"
    1                9        "apples"
    1                10      "pears"
    2                9        "pears"
    2                11     "bananas"

    but if I removed the column 2, 9, "pears" then it will work such as

    ParentID    ID        Name

    null            1        "John"
    null            2         "Ben"
    1                9        "apples"
    1                10      "pears"
    2                11     "bananas"

    Please help because I am stumped on this functionality and would like it working soon as it is the final piece of code to get the entire feature functioning correctly.

    Regards

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 May 2009 Link to this post

    Hi Bill,

    I guess you trying to implement Self-referencing hierarchical Grid to have treeview structure. But for implementing Self-referencing  Grid the ID field which is set as the Key value for the Grid must be having Unique values. In the above post I can see that '9' is repeated for the ID field.  Try using Unique values for the ID field.

    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sergej
    Sergej avatar
    3 posts
    Member since:
    Apr 2008

    Posted 28 May 2009 Link to this post

    Hi,
    I have the same problem. My database contains two tables, one with items while other one is relational table with just child and parent IDs. One item can have multiple parents

    example:

    Cat:
     [CatId] - [CatTitle]
    1 -------- about us
    2 -------- music
    3 -------- video
    4 -------- studio
    5 -------- contact us

    RelCatCat
     [CatCatId] - [ParentId] - [ChildId]
    1 ---------------- null ---------- 1
    2 ---------------- null ---------- 2
    3 ---------------- null ---------- 3
    4 ------------------ 2 ----------- 4
    5 ------------------ 3 ----------- 4
    6 ------------------ 1 ----------- 5

    As you can see hierarchy tree should look like:
    +about us
    --contact us
    +music
    --studio
    +video
    --studio

    Unfortunately I cant found solution for this problem, please help.

    One thing comes to mind, I think it would be possible to add column to dataset fetched from database  that will be used as PK in treeview  and recreate uniqueIDs for records that have multiple parents - this is something I would like to avoid if possible.

  5. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 01 Aug 2010 Link to this post

    The is that when you add relations you have misplaced the arguments. What you need to do is to swap the argument.
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 03 Aug 2010 Link to this post

    Hi Sergej,

    You can solve your problem by making a bit more complex SQL query over the two tables, combining them in a single relation without having duplication in ID's (if 1 element has many parents => should be many elements having a single parent).
    This way you can automatically bind the TreeView to the dataSource instead having multiple dataSources and manually creating the nodes.

    Hope this is helpful for you!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017