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

cant bind radmenu

3 Answers 63 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Teoman Tamer
Top achievements
Rank 1
Teoman Tamer asked on 17 Nov 2009, 01:30 PM

Hi,
I am trying to bind radmenu but it gives me  error "This constraint cannot be enabled as not all values have corresponding parent values."

 

 

 

<telerik:RadMenu ID="RadMenu1" Runat="server" DataFieldID="menuid"

 

 

DataFieldParentID="parentid" DataSourceID="SqlDataSource1"

 

 

DataTextField="menuname">

 

 

</telerik:RadMenu>

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

 

 

SelectCommand="SELECT menuid,parentid,menuname FROM menu"></asp:SqlDataSource>


Menu Table
-------------------------------------
  menuid       parentid     menuname
------------------------------------
     1        0        Products
     2        1        Servers
     3        1        Desktops
     4        1        Notebooks

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 17 Nov 2009, 03:58 PM
Hello Teoman,

Please try to set null for the parentid of root items instead of "0" and let us know how it goes.

Regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Teoman Tamer
Top achievements
Rank 1
answered on 18 Nov 2009, 08:27 PM
thank u.
0
Tyler
Top achievements
Rank 1
answered on 15 Dec 2015, 03:00 PM
Hello, I am having the same problem as him, however, this solution did not work for me
Tags
Menu
Asked by
Teoman Tamer
Top achievements
Rank 1
Answers by
Yana
Telerik team
Teoman Tamer
Top achievements
Rank 1
Tyler
Top achievements
Rank 1
Share this question
or