This question is locked. New answers and comments are not allowed.
Hi,
I've got a sub menu (inside a context menu) that is being built dinamically.
If I've the context menu open or it was open before, and if I try to clear all menu items of the sub menu or try to add a new sub menu, I get an exception:
AG_E_UNKNOWN_ERROR [Line: 1 Position: 1449]
I define a context menu and I set it to open with:
contextMenu.EventName = "MouseLeftButtonDown";
It's defined for a image:
I go to a db get some values to fill the submenu that I fill in a callback (async. get):
Is there anything I am doing wrong? How should this be done?
Thanks for the help,
L. Pinho
I've got a sub menu (inside a context menu) that is being built dinamically.
If I've the context menu open or it was open before, and if I try to clear all menu items of the sub menu or try to add a new sub menu, I get an exception:
AG_E_UNKNOWN_ERROR [Line: 1 Position: 1449]
I define a context menu and I set it to open with:
contextMenu.EventName = "MouseLeftButtonDown";
It's defined for a image:
| <Image x:Name="imgSearch" HorizontalAlignment="Center" Source="/AssemblyName;component/Images/selection-arrow-16x16.png" Height="16" Width="16" Margin="0,2,2,2" Cursor="Hand"> |
| <telerikNavigation:RadContextMenu.ContextMenu> |
| <telerikNavigation:RadContextMenu x:Name="contextMenu" ModifierKey="None" Background="White" Opened="contextMenu_Opened"> |
| <telerikNavigation:RadMenuItem Header="Find" Click="RadMenuItem_Click"> |
| <telerikNavigation:RadMenuItem.Icon> |
| <Image Width="16" Height="16" Source="/AssemblyName;component/Images/Magnifier-16x16.png"/> |
| </telerikNavigation:RadMenuItem.Icon> |
| </telerikNavigation:RadMenuItem> |
| <telerikNavigation:RadMenuItem Header="Simple Query" Click="RadMenuItem_Click"> |
| <telerikNavigation:RadMenuItem.Icon> |
| <Image Width="16" Height="16" Source="/AssemblyName;component/Images/Help-16x16.png" /> |
| </telerikNavigation:RadMenuItem.Icon> |
| </telerikNavigation:RadMenuItem> |
| <telerikNavigation:RadMenuItem x:Name="radMenuItemSavedQueries" Header="Stored Queries" Background="White"> |
| <telerikNavigation:RadMenuItem.Icon> |
| <Image Width="16" Height="16" Source="/AssemblyName;component/Images/save-blue-16x16.png" /> |
| </telerikNavigation:RadMenuItem.Icon> |
| </telerikNavigation:RadMenuItem> |
| </telerikNavigation:RadContextMenu> |
| </telerikNavigation:RadContextMenu.ContextMenu> |
| </Image> |
I go to a db get some values to fill the submenu that I fill in a callback (async. get):
| RadMenuItem menuItem = new RadMenuItem(); |
| foreach (Object result in results) |
| { |
| menuItem = new RadMenuItem() { Header = result.Name, Name = result.Name }; |
| menuItem.Click += new RoutedEventHandler(RadMenuItem_Click); |
| try |
| { |
| radMenuItemSavedQueries.Items.Add(menuItem); |
| } |
| catch (Exception ex) |
| { |
| Console.Write(ex.Message); |
| } |
| } |
Is there anything I am doing wrong? How should this be done?
Thanks for the help,
L. Pinho