这里有两个关于vsflexgrid树形的问题。。
第一个问题,如下代码。
with vsf1
   .RowOutlineLevel(1) = 0
   .IsSubtotal(1) = True
   .RowOutlineLevel(2) = 1
   .IsSubtotal(2) = True
   .RowOutlineLevel(3) = 1
   .IsSubtotal(3) = True
   .RowOutlineLevel(4) = 0
   .IsSubtotal(4) = True
   .RowOutlineLevel(5) = 1
   .IsSubtotal(5) = True   .RowHidden(2) = True
   .RowHidden(3) = True
   .RowHidden(5) = True   .OutlineCol = 1
   .OutlineBar = flexOutlineBarSimpleLeaf
end with
当隐藏下级行时,上级行的左方还是减号,"-" 怎么样才能显示"+".第二问题。。请问vsflexgrid 树形 如何排序,试了好多方法都不成功的,想 
with vsf1   .Col = 0
   .Row = 0
   .Sort = flexSortStringNoCaseAscending   .Cell(flexcpSort, 0, 0, .Rows - 1, 0) = flexSortStringNoCaseAscending
end with试过这两种方法都不成功,难道要自己编写吗。想treeview控件的sorted属性直接设置就ok的那种方法有吗?

解决方案 »

  1.   

    1, 试试OutlineBar = flexOutlineBarCompleteLeaf
    2,.Col = 0
       .Sort = flexSortStringNoCaseAscending
      

  2.   

    我的没问题,用的
    .Subtotal flexSTNone
      

  3.   

    按前面大哥所说的 我做成了下面代码,,可是还没效果啊。。
    With vsf
       .Cols = 0
       .Rows = 0
       .FixedCols = 0
       .FixedRows = 0
       .BackColor = vbWhite
       .BackColorBkg = vbWhite
       .ForeColor = vbBlack
       .SheetBorder = vbWhite
       .FontSize = 12
       .ScrollTrack = True
       .SelectionMode = flexSelectionByRow
       Set .DataSource = rs
       .Cell(flexcpSort, 0, 2, .Rows - 1, 2) = 1
       .ColHidden(0) = True
       .ColHidden(2) = True
       .ColWidth(1) = .Width * 0.9
       For i = 0 To .Rows - 1
          .IsSubtotal(i) = True
          .RowOutlineLevel(i) = jb(.TextMatrix(i, 2))
          'If .RowOutlineLevel(i) <> 0 Then .RowHidden(i) = True
       Next i
       .OutlineCol = 1
       .OutlineBar = 4
       .Subtotal flexSTNone'加了只有还是没反应
    End With怎么样才能只显示父级丫
    效果截图。。