Hello,
I have a RadContextMenu with 2 MenuItems and I need to define SunMenuItems for each of them dynamically in code behind. (because the sub menu items are different based on selected gridview row)
Here is what I have done :
The first time when the contextmenu is opened ,the sub menu show smoothly and fine ,but after first time it doen't display smoothly (I mean with out transition) and even with out border around (please take a look at attached files)
I think it's because of I clearing all the sub items each time by using
However I don't know what would be best approach for doing that , I mean for removing sub items and re add them again .
Also I need to mention that I had to change the RadMenuItem Style because I needed it to have scrollbar in it
http://www.telerik.com/community/forums/silverlight/menu/define-listbox-inside-contextmenu.aspx
The second issue comes after couple of times opening context menu and move to sub menus , it gives me bellow error:
Message: Sydtem.InvalidOperationException: Animation target not specified.
at MS.Internal.XcpImports.MethodEx(InPtr,String name,CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj ,String name)
at Sydtem.Windows.Media.Animation.Storybord.Begin()
at Telerik.Windows.Controls.Animation.AnimationManager.Play(FrameworkElement target,String animationName,Action CompleteCallback,Object[] args)
at Telerik.Windows.Controls.RadMenuItem.RunExpandAnimation(RadMenuItem menuItem)
I appreciate your help,
Thank you so much,
Kind Regards,
Naseem
I have a RadContextMenu with 2 MenuItems and I need to define SunMenuItems for each of them dynamically in code behind. (because the sub menu items are different based on selected gridview row)
Here is what I have done :
private void BadRawContextMenu_Opened(object sender, RoutedEventArgs e)
{
var selItem=((Telerik.Windows.Controls.RadMenuItem)BadRawContextMenu.Items[0]);
selItem.Items.Clear();
selItem.Items.Add(new Telerik.Windows.Controls.RadMenuItem() { Header = "1" });
selItem.Items.Add(new Telerik.Windows.Controls.RadMenuItem() { Header = "2" });
selItem.Items.Add(new Telerik.Windows.Controls.RadMenuItem() { Header = "3" });
selItem.Items.Add(new Telerik.Windows.Controls.RadMenuItem() { Header = "4" });
selItem.Items.Add(new Telerik.Windows.Controls.RadMenuItem() { Header = "5" });
}
The first time when the contextmenu is opened ,the sub menu show smoothly and fine ,but after first time it doen't display smoothly (I mean with out transition) and even with out border around (please take a look at attached files)
I think it's because of I clearing all the sub items each time by using
selItem.Items.Clear();
However I don't know what would be best approach for doing that , I mean for removing sub items and re add them again .
Also I need to mention that I had to change the RadMenuItem Style because I needed it to have scrollbar in it
http://www.telerik.com/community/forums/silverlight/menu/define-listbox-inside-contextmenu.aspx
The second issue comes after couple of times opening context menu and move to sub menus , it gives me bellow error:
Message: Sydtem.InvalidOperationException: Animation target not specified.
at MS.Internal.XcpImports.MethodEx(InPtr,String name,CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj ,String name)
at Sydtem.Windows.Media.Animation.Storybord.Begin()
at Telerik.Windows.Controls.Animation.AnimationManager.Play(FrameworkElement target,String animationName,Action CompleteCallback,Object[] args)
at Telerik.Windows.Controls.RadMenuItem.RunExpandAnimation(RadMenuItem menuItem)
I appreciate your help,
Thank you so much,
Kind Regards,
Naseem