| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1778 人关注过本帖
标题:treeview取数问题
只看楼主 加入收藏
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
结帖率:50%
收藏
 问题点数:0 回复次数:0 
treeview取数问题

以下代码是想实现从库里取数,一个一个加到树型里.可是不知要怎么来判断,下级的所属上级是某一个.

int i,j
datastore d_stroe_1 //定义数据存储对象
d_stroe_1=create datastore
d_stroe_1.dataobject="d_treeview"
d_stroe_1.settransobject(sqlca)
d_stroe_1.retrieve()
i=d_stroe_1.rowcount()

long ll_lev1,ll_lev2

treeviewitem ltv_new,ltv_old
getitem(handle,ltv_old)
for j=1 to i
aa=d_stroe_1.getitemstring(j,"czybh")
bb=d_stroe_1.getitemstring(j,"czy")
cc=d_stroe_1.getitemstring(j,"czyjb")
ltv_new.data=trim(aa)
ltv_new.label=trim(bb)
ltv_new.pictureindex=1
ltv_new.selectedpictureindex=6
ltv_new.children=true
ltv_new.level=integer(trim(cc))

if left(aa,3)=left("czybh",3) then

if ltv_new.level=1 then
ll_lev1=tv_1.insertitemlast(0,aa,1)
else

ll_lev2=tv_1.insertitemlast(ll_lev1,aa,2)
end if

end if
next

搜索更多相关主题的帖子: treeview stroe ltv datastore 
2007-10-10 08:56
快速回复:treeview取数问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017788 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved