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
7 Answers, 1 is accepted
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,
the Telerik team
Thank you for your feedback. But I sill have this problem with radmenuitem. Here is my codes:
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
Could you check my problem raised before? Does telerik menu not solve this problem?
I am waiting for your feedback. Thank you very much
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
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:
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.
the Telerik team