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

These columns don't currently have unique values

4 Answers 1159 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 25 May 2009, 08:03 PM
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

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 May 2009, 06:55 AM
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.
0
Sergej
Top achievements
Rank 1
answered on 28 May 2009, 08:32 AM
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.

0
Vuyiswa
Top achievements
Rank 2
answered on 01 Aug 2010, 09:32 PM
The is that when you add relations you have misplaced the arguments. What you need to do is to swap the argument.
0
Nikolay Tsenkov
Telerik team
answered on 03 Aug 2010, 04:13 PM
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
Tags
TreeView
Asked by
Bill
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sergej
Top achievements
Rank 1
Vuyiswa
Top achievements
Rank 2
Nikolay Tsenkov
Telerik team
Share this question
or