1:TreeList绑定数据源  

当我们给予TreeList 的 parentFieldName 和 KeyFieldName 两个属性之后 会自动的生成树结构。

1 var sql = @" SELECT * FROM  TRAININGANDPROJECT";
2 DataTable dt = SQLiteHelper.ExecuteTable(sql); 
3 treeList1.DataSource = dt; // 将DataTable绑定到 TreeList中。 
4 treeList1.ParentFieldName = "ParentFeidName";   // 绑定父ID段
5  treeList1.KeyFieldName = "KeyFeidName";       //  绑定子ID段

2:设置 TreeList节点 不可编辑

 右键 TreeList控件 --> 属性 --> OptionsBehavior -> Editable : False

 

未完待续。。。

相关文章:

  • 2022-01-10
  • 2022-01-19
  • 2021-09-20
  • 2021-09-24
  • 2021-11-13
  • 2021-05-26
  • 2021-05-28
猜你喜欢
  • 2021-06-15
  • 2022-12-23
  • 2021-08-10
  • 2021-12-07
  • 2021-05-07
  • 2021-08-02
相关资源
相似解决方案