熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java核心技術 >> 正文

Silverlight 中給TreeView添加復選框

2022-06-13   來源: Java核心技術 

  代碼如下

  [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)

  }

  }

  界面效果

   


From:http://tw.wingwit.com/Article/program/Java/hx/201311/26454.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.