ProtoView TreeViewX控件数据绑定问题
绑定TreeViewX控件的vb代码如下所示,其中 rstTree为recordset对象的实例,ptvOrder为treeviewx控件的实例。
strSql = " SHAPE {SELECT distinct 接單日期 FROM vOrdHead_Previous where not 接單日期 is null order by 接單日期} AS Order APPEND ({SELECT 訂單號 , 接單日期 FROM vOrdHead_Previous order by 訂單號} AS OrderList RELATE '接單日期' TO '接單日期') AS OrderList"
rstTree.Open strSql, gProviderShape, adOpenForwardOnly, adLockReadOnly
ptvOrder.DataField(0) = "Order.接單日期"
ptvOrder.DataField(1) = "OrderList.訂單號"
Set ptvOrder.DataSource = rstTree
Set rstTree.ActiveConnection = Nothing
以上的代码实现的功能是将一个两层的recordset对象绑定到treeviewx控件,其中recordset对象的parent层为接单日期,child层为订单号
现在我想在recordset中添加一层,即第一层为客户名称,第二层位接单日期,第三层为订单号,下面是我改写的vb代码,代码是可以执行通过,但在treeviewx控件中却没有体现出三层,仍然是两层,其中第一层为客户名称,第二层为接单日期,第三层没有显示。
如下:
strSql=" SHAPE {SELECT distinct 客戶名稱 FROM vOrdHead_Previous WHERE NOT 客戶名稱 IS NULL ORDER BY 客戶名稱} AS CusNo APPEND ((SHAPE {SELECT 接單日期,客戶名稱 FROM vOrdHead_Previous where not 接單日期 is null order by 接單日期} AS RcvDate APPEND ({SELECT 訂單號 , 接單日期 FROM vOrdHead_Previous order by 訂單號} AS OrderNo RELATE '接單日期' TO '接單日期') AS OrderNo) AS OrderList RELATE '客戶名稱' TO '客戶名稱') as OrderList"
rstTree.Open strSql, gProviderShape, adOpenForwardOnly, adLockReadOnly
ptvOrder.DataField(0) = "CusNo.客戶名稱"
ptvOrder.DataField(1) = "OrderList.接單日期"
ptvOrder.DataField(2) = "OrderList.訂單號"
Set ptvOrder.DataSource = rstTree
Set rstTree.ActiveConnection = Nothing
有朋友遇到过这个问题吗? --------------------编程问答-------------------- 你看看该控件是没有属性做了限制呢?我没有过这控件,帮你顶一下。
补充:VB , 基础类