1
我想添加一个contextmenu到Forms.DataGridView。 我的尝试失败<wf:MenuItem Text="Save" Click="menuFEInsertLine_Click">
告诉我,MenuItem不能添加到MenuItemCollection。此外,该字符串预计。 我怎样才能让这个xaml工作?WPF表格DataGridView上下文菜单
<WindowsFormsHost Name="wfhFileEditorWindow" DockPanel.Dock="Top" HorizontalAlignment="Stretch" AllowDrop="True" Background="White" VerticalAlignment="Stretch">
<WindowsFormsHost.Child>
<local:DataGridViewEx x:Name="dgFileEditorWindow" AllowDrop="True" BackColor="White" BackgroundColor="White">
<local:DataGridViewEx.ContextMenu>
<wf:ContextMenu>
<wf:ContextMenu.MenuItems>
<wf:MenuItem Text="Save" Click="menuFEInsertLine_Click">
<wf:MenuItem.Icon>
<Image Source="star.png"/>
</wf:MenuItem.Icon>
</wf:MenuItem>
<wf:MenuItem Header="Save" Click="menuFEDeleteLine_Click">
<MenuItem.Icon>
<Image Source="delete.png"/>
</MenuItem.Icon>
</wf:MenuItem>
第二'MenuItem'没有'WF的图标('MenuItem.Icon')。 ..你确定这是正确的吗? – Jcl
这是不对的。我纠正了它,但它仍然在同一个地方休息。 – Adder