有什么方法可以在 Microsoft.Reporting.WebForms.ReportViewer 控件中添加我的自定义控件。
我正在开发 ASP.NET Web 应用程序,我想在 reportviewer 的工具栏中添加我的自定义控件。
阅读这个blogspot看起来这在 WinForms 中是可能的。
因此,我开始编写我自己的继承 ReportViewer 的 RerpotViewerClass 并在开始时堆叠起来。看起来我不能覆盖 WebForms 上的 OnControlAdded 方法?
然后我使用 OnLoad() 或任何其他方法?
public class ReportViewerToolbarExtension : Microsoft.Reporting.WebForms.ReportViewer
{
protected override void OnControlAdded(ControlEventArgs e)
{
base.OnControlAdded(e);
}
}
引发错误
'Microsoft.Reporting.WebForms.ReportViewer' does not contain a definition for 'OnControlAdded'
“ControlEventArgs”对我来说也是痛苦的一部分吗?
当我尝试实现 SetToolStripItems(Control c)
我不能使用 ToolStripItemCollection 也工具条,因为它们属于命名空间 System.Windows.Forms。
我应该引用 WinForms 还是 Web 命名空间中有模拟控件?