Huy Truong The
Top achievements
Rank 1
Huy Truong The
asked on 18 Aug 2009, 04:00 AM
Hello,
I’m having a trouble in using the RadMenuItem. I have 3 RadMenuItems on a R form .
After I close the Form R and re-enter the a R form by new an instance of a R form. There a exception errors “That is already exits the rad menu item name “ I use in the R form.
I think all the radmenuItem is declare static scope so it not still exists after I close or dipose the form
Could you please tell me why it happened? Thank you
Regards,
Huy
7 Answers, 1 is accepted
0
Hi,
This problem is caused by a bug in the Silverlight Popup control that is triggered in certain scenarios. To avoid it, you should not set x:Name on RadMenuItem controls.
All the best,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
This problem is caused by a bug in the Silverlight Popup control that is triggered in certain scenarios. To avoid it, you should not set x:Name on RadMenuItem controls.
All the best,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Huy Truong The
Top achievements
Rank 1
answered on 20 Aug 2009, 02:54 AM
Thank you for your feedback
Best regards,
Huy
Best regards,
Huy
0
Huy Truong The
Top achievements
Rank 1
answered on 20 Aug 2009, 03:01 AM
Hello,
Thank you for your feedback. But I sill have this problem with radmenuitem. Here is my codes:
SilverlightControl1.xaml
SilverlightControl1.xaml.cs
Page.xaml
Page.xaml.cs
I do not know why it still has this problem because I think menu control is a very common control. Could you please help me figure out why it is? Thank you very much
Huy
Thank you for your feedback. But I sill have this problem with radmenuitem. Here is my codes:
SilverlightControl1.xaml
|
SilverlightControl1.xaml.cs
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Net; |
using System.Windows; |
using System.Windows.Controls; |
using System.Windows.Documents; |
using System.Windows.Input; |
using System.Windows.Media; |
using System.Windows.Media.Animation; |
using System.Windows.Shapes; |
namespace SilverlightApplication2 |
{ |
public partial class SilverlightControl1 : UserControl |
{ |
public SilverlightControl1() |
{ |
InitializeComponent(); |
} |
private void btnView_Click(object sender, RoutedEventArgs e) |
{ |
Page a = new Page(); |
App.Navigate(a); |
} |
} |
} |
Page.xaml
|
Page.xaml.cs
|
I do not know why it still has this problem because I think menu control is a very common control. Could you please help me figure out why it is? Thank you very much
Huy
0
Huy Truong The
Top achievements
Rank 1
answered on 21 Aug 2009, 07:44 AM
Hello Valeri,
Could you check my problem raised before? Does telerik menu not solve this problem?
I am waiting for your feedback. Thank you very much
Regards,
Huy
Could you check my problem raised before? Does telerik menu not solve this problem?
I am waiting for your feedback. Thank you very much
Regards,
Huy
0
Hi Huy,
If you remove the x:Name attributes from all RadMenuItem controls the problem will go away.
Sincerely yours,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
If you remove the x:Name attributes from all RadMenuItem controls the problem will go away.
Sincerely yours,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Huy Truong The
Top achievements
Rank 1
answered on 21 Aug 2009, 10:56 AM
Hi Valeri ,
Normally, x:Name attribute from a control is used for keeping the control identity in common. It really surprises that i can not use this attribute in your RadMenuItem and the control problem is coming for this reason.
In this case, when using this RadMenuItem, what is the way you keep the each menu item identity? I wish it is not so weird.
Thank you for your help
Huy
Normally, x:Name attribute from a control is used for keeping the control identity in common. It really surprises that i can not use this attribute in your RadMenuItem and the control problem is coming for this reason.
In this case, when using this RadMenuItem, what is the way you keep the each menu item identity? I wish it is not so weird.
Thank you for your help
Huy
0
Hello Huy,
I fully understand that the problem with the x:Name attribute is a serious limitation, but unfortunately we were unable to find a way to solve it. I want to say again that it is a bug in the Silverlight Popup control, that can be reproduced without RadMenu or any Telerik control.
To keep the identity of the RadMenuItems I would recommend two workarounds:
1) Use the Tag property to keep a string or other object that will uniqueli identify the item.
2) Databind RadMenu and use the data objects, instead of RadMenuItems in your application logic:
http://demos.telerik.com/silverlight/#Menu/DataBinding
I personally would recommend data-binding, because it provides much greater control and UI/logic separation. Of course, if you want just a simple menu, the Tag property would be better.
Regards,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I fully understand that the problem with the x:Name attribute is a serious limitation, but unfortunately we were unable to find a way to solve it. I want to say again that it is a bug in the Silverlight Popup control, that can be reproduced without RadMenu or any Telerik control.
To keep the identity of the RadMenuItems I would recommend two workarounds:
1) Use the Tag property to keep a string or other object that will uniqueli identify the item.
2) Databind RadMenu and use the data objects, instead of RadMenuItems in your application logic:
http://demos.telerik.com/silverlight/#Menu/DataBinding
I personally would recommend data-binding, because it provides much greater control and UI/logic separation. Of course, if you want just a simple menu, the Tag property would be better.
Regards,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.