以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  目录树问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=65530)

--  作者:qianqian1530
--  发布时间:2015/3/17 21:34:00
--  目录树问题
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
tr.BuildTree("表A", "大类|二类|三类")

我想直接 生成 三类. 

因为一类和 二类是固定的.

当 目录树是空白的时候,怎么直接生成 三类呢? 生成后,展开生成的三类.

--  作者:有点甜
--  发布时间:2015/3/17 21:38:00
--  

呃...加一列表达式列,设置 iif(大类 > \'\', 大类, \'空白\') & \'\\\' & iif(二类 > \'\', 二类, \'空白\') & \'\\\' & 三类

 

然后用createTree http://www.foxtable.com/help/topics/1970.htm

 


--  作者:qianqian1530
--  发布时间:2015/3/17 21:43:00
--  
那 如何 展开 最新添加的   三类呢
--  作者:有点甜
--  发布时间:2015/3/17 21:44:00
--  
 不是弄了一个空白的字符串么?
--  作者:qianqian1530
--  发布时间:2015/3/17 21:46:00
--  
不明白...
--  作者:有点甜
--  发布时间:2015/3/17 21:47:00
--  

 我也不知道你想说什么。

 

 你表数据修改了,你就得重新生成目录树啊


--  作者:qianqian1530
--  发布时间:2015/3/17 21:55:00
--  
 Dim dr As DataRow = DataTables("S_系统_HTML").AddNew
    dr("平台") = e.Form.Controls("ComboBox1").text \'就两个选项,
    dr("店铺") = e.Form.Controls("ComboBox2").text \'两个选项
    dr("网页名") = e.Form.Controls("TextBox1").text \' 随便输入
    Dim tr As WinForm.TreeView = Forms("网页更新").Controls("TreeView1")
    tr.BuildTree("S_系统_HTML", "平台|店铺|网页名)
    tr.ExpandAll

但是这么写的话, 会全部展开```
但我只想展开 刚刚添加的最后一行..

这么说能明白我的意思么...图片点击可在新窗口打开查看
[此贴子已经被作者于2015/3/17 21:55:11编辑过]

--  作者:有点甜
--  发布时间:2015/3/17 21:59:00
--  
Dim dr As DataRow = DataTables("S_系统_HTML").AddNew
dr("平台") = e.Form.Controls("ComboBox1").text \'就两个选项,
dr("店铺") = e.Form.Controls("ComboBox2").text \'两个选项
dr("网页名") = e.Form.Controls("TextBox1").text \' 随便输入
Dim tr As WinForm.TreeView = Forms("网页更新").Controls("TreeView1")
tr.BuildTree("S_系统_HTML", "平台|店铺|网页名")
For Each nd As WinForm.TreeNode In tr.AllNodes
    If nd.Level = 2 Then
        If nd.DataRow("_Identify") = dr("_Identify")
            nd.Expand
            Exit For
        End If
    End If
Next

--  作者:qianqian1530
--  发布时间:2015/3/17 22:56:00
--  
Dim dr As DataRow = DataTables("S_系统_HTML").AddNew
DataTables("S_系统_HTML").Save() 
  dr("平台") = e.Form.Controls("ComboBox1").text \'就两个选项,
dr("店铺") = e.Form.Controls("ComboBox2").text \'两个选项
dr("网页名") = e.Form.Controls("TextBox1").text \' 随便输入
Dim tr As WinForm.TreeView = Forms("网页更新").Controls("TreeView1")
tr.BuildTree("S_系统_HTML", "平台|店铺|网页名")
For Each nd As WinForm.TreeNode In tr.AllNodes
    If nd.Level = 2 Then
        If nd.DataRow("_Identify") = dr("_Identify")
           tr.SelectedNode = nd 
            Exit For
        End If
    End If
Next