有没有datawindow Treeview的例证

有没有datawindow Treeview的例子?
比如我有一个表有三个字段:
id (树结点)
父ID (树的父结点)
树结点标签

那么新建Datawindow时选择treeview视图,能不能不需要代码就把上面的树视表加载了?





------解决方案--------------------
不可能,必须写代码
------解决方案--------------------
探讨
不可能,必须写代码

------解决方案--------------------
举个例子;
如建一个的datawindow,数据包括省、市、县
dw_1需按省、市、县排序
//tv
treeviewitem tv_item
tv_1.setredraw(false)
str_sheng = '' 
str_shi = ''
str_xian = ''
for i = 1 to dw_1.rowcount()
if str_sheng = trim(ds1.getitemstring(i,'省')) then
if str_shi = trim(ds1.getitemstring(i,'市')) then
//县
tv_item.label = trim(ds1.getitemstring(i,'县'))
tv_item.pictureindex = 3
tv_item.selectedpictureindex = 4
tv_xian = tv_1.insertitemlast(tv_shi, tv_item)
else
//市
str_shi = trim(ds1.getitemstring(i,'市'))
tv_item.label = str_shi
tv_item.pictureindex = 1
tv_item.selectedpictureindex = 2
tv_shi = tv_1.insertitemlast(tv_sheng, tv_item)
//县
tv_item.label = trim(ds1.getitemstring(i,'县'))
tv_item.pictureindex = 1
tv_item.selectedpictureindex = 2
tv_xian = tv_1.insertitemlast(tv_shi, tv_item)
end if
else
//省
str_sheng = trim(ds1.getitemstring(i,'省'))
tv_item.label = str_sheng
tv_item.pictureindex = 1
tv_item.selectedpictureindex = 2
tv_sheng = tv_1.insertitemlast(tv_yt, tv_item)
//市
str_shi = trim(ds1.getitemstring(i,'市'))
tv_item.label = str_shi
tv_item.pictureindex = 1
tv_item.selectedpictureindex = 2
tv_shi = tv_1.insertitemlast(tv_sheng, tv_item)
//县
tv_item.label = trim(ds1.getitemstring(i,'县'))
tv_item.pictureindex = 3
tv_item.selectedpictureindex = 4
tv_xian = tv_1.insertitemlast(tv_shi, tv_item)
end if
next
tv_1.setredraw(true)


------解决方案--------------------
http://download.****.net/source/780615
------解决方案--------------------
完全不需要代码!

我的PB10.5附带的CodeExamples里就有这样的例子。

创建DataWindow Object时,选TreeView,指定第一Level的字段。

然后在设计画板(Painter)中增加其他Level的字段即可。操作方法是:菜单Rows,Create TreeView Level,指定字段。