GrapeCity.ActiveReports.Viewer.Wpf.Viewer.ContextMenu 如何添加菜单?
wpf代码:
xmlns:MyViewer="clr-namespace:GrapeCity.ActiveReports.Viewer.Wpf;assembly=GrapeCity.ActiveReports.Viewer.Wpf.v10"
<MyViewer:Viewer Grid.Column="1" x:Name="viewer1" />
.cs代码:
MenuItem _exportButton = new MenuItem();
this._exportButton.Name = "Export";
this._exportButton.Header = "导出";
this._exportButton.IsEnabled = false;
this._exportButton.ToolTip = "导出报表";
this.viewer1.ContextMenu = new ContextMenu();
this.viewer1.ContextMenu.Items.Add(_exportButton);
代码如上,但却添加不上菜单。求助。
|
|