VSFlexGrid 合计项与排序问题的解决方法
2010-09-28 16:39
323 查看
Private Sub VS1_BeforeSort(ByVal Col As Long, Order As Integer) '排序前删除合计项
With VS1
If .TextMatrix(.Rows - 1, 1) = "合 计" Then '判断最后列是否是合计行
.Redraw = False
.RemoveItem (.Rows - 1)
End If
End With
End Sub
Private Sub VS1_AfterSort(ByVal Col As Long, Order As Integer) '排序后添加合计项
With VS1
If .TextMatrix(.Rows - 1, 1) <> "合 计" Then '判断如果最后列不是合计行那么添加合计行
.Rows = .Rows + 1
Dim r&, c&, tot!
For c = 6 To 8
tot = 0
For r = 1 To .Rows - 2
tot = tot + .ValueMatrix(r, c)
Next
.TextMatrix(r, c) = tot
Next
.TextMatrix(.Rows - 1, 1) = "合 计"
.Cell(flexcpAlignment, .Rows - 1, 1, .Rows - 1, 1) = flexAlignCenterCenter '合计两字居中对齐
End If
.Redraw = True
End With
End Sub
With VS1
If .TextMatrix(.Rows - 1, 1) = "合 计" Then '判断最后列是否是合计行
.Redraw = False
.RemoveItem (.Rows - 1)
End If
End With
End Sub
Private Sub VS1_AfterSort(ByVal Col As Long, Order As Integer) '排序后添加合计项
With VS1
If .TextMatrix(.Rows - 1, 1) <> "合 计" Then '判断如果最后列不是合计行那么添加合计行
.Rows = .Rows + 1
Dim r&, c&, tot!
For c = 6 To 8
tot = 0
For r = 1 To .Rows - 2
tot = tot + .ValueMatrix(r, c)
Next
.TextMatrix(r, c) = tot
Next
.TextMatrix(.Rows - 1, 1) = "合 计"
.Cell(flexcpAlignment, .Rows - 1, 1, .Rows - 1, 1) = flexAlignCenterCenter '合计两字居中对齐
End If
.Redraw = True
End With
End Sub
相关文章推荐
- Lucene搜索结果排序问题(按时间倒序排的替代解决方法)
- Oracle分页查询中排序与效率问题解决方法详解
- 产品列表显示的位置上移下移排序的问题的解决方法!
- CxGrid中文排序错误问题解决方法
- MapReduce二次排序中遇到的问题,及解决方法
- 排序算法--7大排序问题解决方法
- datagrid控件在排序后出现问题的解决方法
- 一种高效率的排序方法-归并排序的实现(主要解决matlab中多维数组排序的问题)
- js关于对象键值为数字型时输出的对象自动排序问题的解决方法
- Lucene搜索结果排序问题(按时间倒序排的替代解决方法)
- 解决JTable排序问题的方法详解
- DataTable 手动排序 无效的问题解决方法??
- 探讨两种方法解决大小、数字字符排序问题
- Mybatis返回list排序无效问题解决方法
- 递归的定义以及递归的示例(计算阶乘、计算斐波那契数、递归二分查找、回文串递归方法解决、汉诺塔问题、递归选择排序问题)
- Mybatis排序无效问题解决方法
- discuz x2 个人资料项排序问题解决方法、添加自定义字段、修改栏目名称和介绍
- 完美解决NC502手工sql的查询引擎排序及合计问题
- N位数排序问题的通用解决方法
- CxGrid表格中文排序错误问题解决方法