Hi,
I created a basic user control with RadMenu in it:
Then I placed this user control in a page twice:
When I executed the page and hovered over the menu "test", everything went fine, until I hovered over the second menu "test1". which gave me the error: "The Name Already Exists in the Tree: subItem1.. MethodName: "
It actually started happening in the application we are really working on. In there we have a page which has RadMenu. If we open the instance of that page for the first time, everything goes fine. But either if we close the opened page and reopen it and try to hover over the menu, it gives us the same problem. Similarly, if we had open two instances of the page which has RadMenu, the first page works all fine but on the second page if you try to access the menu you get the same error.
BUT, this problem disappears if we stop using "x:name" for menu and the items for the menu. Seems like this menu has some static property which causes the conflict.
I would love to know your thoughts about this, because to me it seems like a bug, I might be wrong though.
Regards,
OM
I created a basic user control with RadMenu in it:
<UserControl x:Class="MenuTest.menu" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:radMenu="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
Width="400" Height="300"> |
<Grid x:Name="LayoutRoot" Background="White"> |
<radMenu:RadMenu x:Name="rad1" > |
<radMenu:RadMenuItem x:Name="mainitem1" Header="main"/> |
<radMenu:RadMenuItem x:Name="mainitem2" Header="main2"> |
<radMenu:RadMenuItem x:Name="subitem1" Header="sub1" /> |
<radMenu:RadMenuItem x:Name="subitem2" Header="sub2" /> |
</radMenu:RadMenuItem> |
</radMenu:RadMenu> |
</Grid> |
</UserControl> |
Then I placed this user control in a page twice:
<UserControl x:Class="MenuTest.Page" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:local="clr-namespace:MenuTest" |
Width="400" Height="300"> |
<Grid x:Name="LayoutRoot" Background="White"> |
<Grid.RowDefinitions> |
<RowDefinition Height="20"/> |
<RowDefinition Height="20"/> |
</Grid.RowDefinitions> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="200"/> |
<ColumnDefinition Width="200"/> |
</Grid.ColumnDefinitions> |
<local:menu x:Name="test" Grid.Row="0"></local:menu> |
<local:menu x:Name="test1" Grid.Row="1"></local:menu> |
</Grid> |
</UserControl> |
When I executed the page and hovered over the menu "test", everything went fine, until I hovered over the second menu "test1". which gave me the error: "The Name Already Exists in the Tree: subItem1.. MethodName: "
It actually started happening in the application we are really working on. In there we have a page which has RadMenu. If we open the instance of that page for the first time, everything goes fine. But either if we close the opened page and reopen it and try to hover over the menu, it gives us the same problem. Similarly, if we had open two instances of the page which has RadMenu, the first page works all fine but on the second page if you try to access the menu you get the same error.
BUT, this problem disappears if we stop using "x:name" for menu and the items for the menu. Seems like this menu has some static property which causes the conflict.
I would love to know your thoughts about this, because to me it seems like a bug, I might be wrong though.
Regards,
OM