Link to home
Create AccountLog in
Web Development

Web Development

--

Questions

--

Followers

Top Experts

Avatar of DStarkey
DStarkey

Treeview Error
I am trying to implement a treeview (using telerik controls) and am running into an error.
"This constraint cannot be enabled as not all values have corresponding parent values." Attached is a snap shot of my table which holds information for the treeview. Does the structure need to change?  Any help would be greatly appreciated


 Thanks
table.JPG

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of DStarkeyDStarkey

ASKER

I was able to get the treeview to half way work.... If I remove the ParentID it displays my reports in a list....
It does not like the ParentID for some reason.... ?

Avatar of carlnorrbomcarlnorrbom🇸🇪

Hi,

Been a while since I worked with Telerik treeview control, but what if you specify ParentID = 0 instead of NULL? I believe I have a telerik treeview in one of our customer apps, I can check when I return to work on Monday.

/Carl.

carlnorrbom,
I would be grateful if you were able to check this out Monday. I tried to use ParentID = 0 and received the same error as above.

Thanks

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


there is no problem with your structure
but the only thing is how you relate your tables
only problem wuld be the relation u are passing just reverse your relation and give a try

tonykachappilly,
Thanks for the reply.
I did play with the relations and end up getting the same error. I know sql but I am not an expert. I have attached the table diagram and the sql I am using to get my report list. Please review

Thanks





SELECT CMSC.Reports.Text, CMSC.Reports.Description, CMSC.Reports.Report, CMSC.Reports.ParentID, CMSC.ReportRoleRelation.rID FROM CMSC.Reports INNER JOIN CMSC.ReportRoleRelation ON CMSC.ReportRoleRelation.rID = CMSC.Reports.rID WHERE (CMSC.ReportRoleRelation.RoleID = @param)

Open in new window

Relation.JPG

are u using any dataview ..? or are you getting the error when you run the query..?
 

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


I am using a Stored procedure which goes into a Datatable within a class, which I use as the datasource for the treeview.... I get the error when the treeview control loads....

ASKER CERTIFIED SOLUTION
Avatar of mattibuttmattibutt🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

I forgot I had this open. I ended up upgrading my telerik controls and it worked fine.
Web Development

Web Development

--

Questions

--

Followers

Top Experts

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.