以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 取消合并单元格 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=171762) |
||||
-- 作者:采菊东篱下 -- 发布时间:2021/9/8 17:46:00 -- 取消合并单元格 通过窗口添加科目,保存后发现添加的行替代了原来的合计行,会计代码与会计科目合并了,如何取消原来的合并单元格,这是原来的合并代码: With Tables("初始数据_Table6") .Grid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom Dim rng6 As C1.Win.C1FlexGrid.CellRange = .Grid.GetCellRange(.Rows.count - 1, 1, .Rows.count - 1, 2) .Grid.MergedRanges.Add(rng6) .Grid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom Dim rng7 As C1.Win.C1FlexGrid.CellRange = .Grid.GetCellRange(.Rows.count, 1, .Rows.count, 2) .Grid.MergedRanges.Add(rng7) End With
[此贴子已经被作者于2021/9/8 17:54:28编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2021/9/9 8:38:00 -- 把这段代码删除掉不就行了 |
||||
-- 作者:采菊东篱下 -- 发布时间:2021/9/9 11:21:00 -- 增行代码在会计科目窗口,上面的设置单元格合并在初始数据窗口,初始数据窗口中的科目增减要通过会计科目窗口添加,按保存按钮添加到初始数据窗口对应的表中,但添加科目后,出现新添的科目替换了初始数据窗口对应表的合计行,上现在代码不能删除,删除就看不到合并了,只能在保存时取消原来的合计单元格。 |
||||
-- 作者:采菊东篱下 -- 发布时间:2021/9/9 11:24:00 -- 如果初始数据表的科目代码列,不含“%总计",取消合并单元格。 |
||||
-- 作者:有点蓝 -- 发布时间:2021/9/9 13:35:00 -- 参考:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=76838 |
||||
-- 作者:采菊东篱下 -- 发布时间:2021/9/9 16:54:00 -- 你连接上的代码是随意选的区域,我的问题是取消指定表最后一行、两行科目代码列不为总计的合并单元格,我写了一下脑子很混乱,测试后并没实现我要的效果: Dim bs() As String = {1,2,3,5} For Each b As String In bs With Tables("初始数据_Table" & b) Dim rng As New List(of Object) .Grid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom If .TopRow+1 <> .Rows.count - 1 And .BottomRow+1 <> .Rows.count - 1 Then For Each r As object In rng .Grid.MergedRanges.Remove(r) Next End If End With Next Dim bs1() As String = {4,6} For Each b1 As String In bs1 With Tables("初始数据_Table" & b1) Dim rng1 As New List(of Object) .Grid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom If .TopRow+1 <> .Rows.count - 1 And .BottomRow+1 <> .Rows.count - 1 Then For Each r1 As object In rng1 .Grid.MergedRanges.Remove(r1) Next End If Dim rng2 As New List(of Object) .Grid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom If .TopRow + 1 <> .Rows.count And .BottomRow + 1 <> .Rows.count Then For Each r2 As object In rng2 .Grid.MergedRanges.Remove(r2) Next End If End With Next |
||||
-- 作者:有点蓝 -- 发布时间:2021/9/9 17:00:00 -- 请上传实例说明 |
||||
-- 作者:采菊东篱下 -- 发布时间:2021/9/9 17:36:00 --
|
||||
-- 作者:有点蓝 -- 发布时间:2021/9/9 20:29:00 -- …… For i As Integer = 1 To sr.length If Forms("初始数据").ExistControl("Table" & i) Then Tables("初始数据_Table" & i).DataTable.Load() Tables("初始数据_Table" & i).DataTable.DataCols("科目名称").RaiseDataColChanged() End If Next Dim bs() As String = {1,2,3,4,5,6} For Each b As String In bs With Tables("初始数据_Table" & b) For i As Integer = .Grid.MergedRanges.count - 1 To 0 Step -1 .Grid.MergedRanges.Removeat(i) Next End With Next Case "取消" \'取消代码 e.Form.Close() End Select …… |
||||
-- 作者:采菊东篱下 -- 发布时间:2021/9/9 21:29:00 -- 直接简化为这样,试过没问题了。 For i As Integer = 1 To sr.length If Forms("初始数据").ExistControl("Table" & i) Then With Tables("初始数据_Table" & i) .DataTable.Load() .DataTable.DataCols("科目名称").RaiseDataColChanged() For c As Integer = .Grid.MergedRanges.count - 1 To 0 Step -1 .Grid.MergedRanges.Removeat(c) Next End With End If Next
|