以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]isgroup在Drawcell的应用  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=116333)

--  作者:chnfo
--  发布时间:2018/3/22 22:57:00
--  [求助]isgroup在Drawcell的应用
在全局表事件的Drawcell事件中这样写

If e.Row.Index = e.Table.Current.Index AndAlso e.Row.IsGroup = False  Then
    e.Style = "行样式"
End If

但是在汇总模式下,点击到分组行时,会报错。

如果想让在点击分组行时,也显示行样式,该怎么写?

或者点击分组行时,不触发drawcell事件,该咋整?

[此贴子已经被作者于2018/3/22 23:00:05编辑过]

--  作者:chnfo
--  发布时间:2018/3/22 23:13:00
--  
试了一下,再加入一层判断  if e.table.current isnot nothing 似乎可以解决这个问题 
--  作者:有点甜
--  发布时间:2018/3/22 23:17:00
--  

改成

 

If e.Row.IsGroup = False AndAlso e.Row.Index = e.Table.Current.Index Then
    e.Style = "行样式"
End If