电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

Silverlight 中给TreeView添加复选框


发布日期:2024/5/18
 

代码如下

[csharp]

List<IrrlSysFun> datas;

public CWRoleRight()

{

InitializeComponent()

BLLSysFunBLLFindAll(list => {

datas = listToList()

LoadTree(treeViewItems

})

}

private void LoadTree(ItemCollection itemCollection int p)

{

var subList = datasWhere(d => dpid == p)ToList()

foreach (var item in subList)

{

TreeViewItem tv = new TreeViewItem()

StackPanel sp = new StackPanel()

CheckBox cb = new CheckBox()

cbChecked += new RoutedEventHandler(cb_Checked)

cbContent = itemnodeText;

cbTag = tv;

spChildrenAdd(cb)

tvHeader = sp;

itemCollectionAdd(tv)

tvIsExpanded = true;

LoadTree(tvItems itemnodeid)

}

}

界面效果

上一篇:Swing框架中设计模式的误用

下一篇:次小生成树 Tree-LCA的位运算