I want to full my context menu whith items in run time.
RadContextMenu
d = new RadContextMenu();
RadMenuItem y = new RadMenuItem();
d.items.add(y);
y is child of d.
I want to add items to y in click event.
The code in click event:
RadMenuItem h1 = new RadMenuItem();
h1.Header =
"h1";
y.items.add(h1);
but I get Error:" AG_E_UNKNOWN_ERROR".
The details:
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at MS.Internal.XcpImports.Control_ApplyTemplate(Control control)
at System.Windows.Controls.Control.ApplyTemplate()
at Telerik.Windows.Controls.RadMenuItem.ChangeTemplate(MenuItemRole role)
at Telerik.Windows.Controls.RadMenuItem.UpdateRole()
at Telerik.Windows.Controls.RadMenuItem.OnItemsChanged(NotifyCollectionChangedEventArgs e)
at System.Windows.Controls.ItemsControl.RaiseOnItemsChanged(NotifyCollectionChangedEventArgs e)
at System.Windows.Controls.ItemCollection.NotifyItemsControl(NotifyCollectionChangedEventArgs e)
at System.Windows.Controls.ItemCollection.AddInternal(Object value)
at System.Windows.PresentationFrameworkCollection`1.Add(T value)
at W6.Web.UI.Actions.Class1.Invoke(IList selectedObjectsInFocus)
Can you help me??
Thanks.