Hi everyone.
I've a problem with my TreeView controls. the problem is;
When I try to bind data from DB to RadTreeView, it gives this error : "This constraint cannot be enabled as not all values have corresponding parent values."
C# Code :
line 2 is connects to DB and fill the datatable from another class.
when I write the query :"SELECT * FROM dbo.FESTIVAL", there was no problem but when I add it "WHERE flag=0" clause to filter some data at "line 1" it gives me error. And interesting point is When I change the Flag value to "1" (flag=1) it works fine !!, it makes me crazy.
I search all the topics in "Telerik Forums" and there were some problems as mine, but my table is not spereated and all the Parent_id's values are "NULL"
so what can I do at this situation?
Database DataTable:
cat_id is a child_id. title column has some words will placed on node.
dbo.Festival
Fest_id Cat_id flag title
1 NULL 0
2 NULL 1
3 NULL 0
4 NULL 1
5 NULL 0
6 NULL 1
7 NULL 0
8 NULL 1
9 NULL 0
10 NULL 1
11 NULL 0
12 NULL 1
13 NULL 0
14 NULL 1
15 NULL 0
16 NULL 1
17 NULL 0
18 NULL 1
19 NULL 0
20 NULL 1
21 1 0
22 1 1
23 1 0
24 1 1
25 2 0
26 2 1
27 2 0
28 2 1
29 3 0
30 3 1
31 4 0
32 4 1
33 7 0
34 7 1
35 8 0
36 8 1
37 9 0
38 9 1
39 10 0
...it goes until 180 records.
I've a problem with my TreeView controls. the problem is;
When I try to bind data from DB to RadTreeView, it gives this error : "This constraint cannot be enabled as not all values have corresponding parent values."
C# Code :
private void ForTree() |
{ |
line 1:String Query = "SELECT * FROM dbo.FESTIVAL WHERE flag=0"; |
line 2:myDataTable3 = dtClass.GetQuery(Query); |
RadTreeView3.DataSource = myDataTable3; |
RadTreeView3.DataFieldID = "fest_id"; |
RadTreeView3.DataValueField = "fest_id"; |
RadTreeView3.DataFieldParentID = "cat_id"; |
RadTreeView3.DataTextField = "title"; |
line 8:RadTreeView3.DataBind(); // This is the line where error occurs. |
} |
line 2 is connects to DB and fill the datatable from another class.
when I write the query :"SELECT * FROM dbo.FESTIVAL", there was no problem but when I add it "WHERE flag=0" clause to filter some data at "line 1" it gives me error. And interesting point is When I change the Flag value to "1" (flag=1) it works fine !!, it makes me crazy.
I search all the topics in "Telerik Forums" and there were some problems as mine, but my table is not spereated and all the Parent_id's values are "NULL"
so what can I do at this situation?
Database DataTable:
cat_id is a child_id. title column has some words will placed on node.
dbo.Festival
Fest_id Cat_id flag title
1 NULL 0
2 NULL 1
3 NULL 0
4 NULL 1
5 NULL 0
6 NULL 1
7 NULL 0
8 NULL 1
9 NULL 0
10 NULL 1
11 NULL 0
12 NULL 1
13 NULL 0
14 NULL 1
15 NULL 0
16 NULL 1
17 NULL 0
18 NULL 1
19 NULL 0
20 NULL 1
21 1 0
22 1 1
23 1 0
24 1 1
25 2 0
26 2 1
27 2 0
28 2 1
29 3 0
30 3 1
31 4 0
32 4 1
33 7 0
34 7 1
35 8 0
36 8 1
37 9 0
38 9 1
39 10 0
...it goes until 180 records.