我们正在C#中开发窗体应用程序。我们已经成功地将scopenode和子代码添加到该scopenode中,如下所示
this.RootNode = new ScopeNode();
this.RootNode.DisplayName = "Poseidon Security Manager";
FormViewDescription fvd = new FormViewDescription();
fvd.DisplayName = "Poseidon Security Dashboard";
fvd.ViewType = typeof(ServiceViewForm);
fvd.ControlType = typeof(ServiceUserControl);
//RootNode.ViewDescriptions.Add(fvd);
ScopeNode scopeNode = new ScopeNode();
scopeNode.DisplayName = "Configuration Management";
ScopeNode sNode = new ScopeNode();
sNode.DisplayName = "Endpoints";
scopeNode.Children.Add(GetDeviceTypeList(sNode));
RootNode.Children.Add(scopeNode);
RootNode.ViewDescriptions.Add(new FormViewDescription() { ControlType = typeof(ServiceUserControl), ViewType = typeof(ServiceViewForm), DisplayName = "Poseidon Security Dashboard", Tag = scopeNode });在ServiceUserControl中我们有一个按钮。在该按钮上单击事件,我们要显示“波塞冬安全管理器”的子级。这意味着我们希望扩展“波塞冬安全管理器”scopeNode并显示“配置管理”scopenode。怎么做?你能提供解决方案吗?
发布于 2016-06-26 10:30:09
在用户控件中,我们需要在其中一个方法中调用FormView的对象,如下所示
formView.SelectScopeNode(selectedScopeNode);它会自动展开selectedScopeNode和selectedScopeNode的所有父节点结构,并突出显示。
https://stackoverflow.com/questions/37941276
复制相似问题