以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]drawcell当遇到汇总时报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107641) |
-- 作者:wendude -- 发布时间:2017/10/6 12:40:00 -- [求助]drawcell当遇到汇总时报错 drawcell内全部的代码: e.Table.DataTable.AddUserStyle("标记",Color.White,Color.Red) If e.Row(e.Col.Name) <> e.Row.DataRow.OriginalValue(e.Col.Name) Then e.Style = "标记" End If DataTables("人员编制及到位人员").SysStyles("ModifiedCell").BackColor = Color.White Dim t As String = e.Table.Name Dim r As String = e.Row("_Identify") Dim c As String = e.Col.Name Dim filter As String = "表 = \'" & t & "\' and 行 = \'" & r & "\' and 列 = \'" & c & "\'" Dim fdr As DataRow = DataTables("表B").Find(filter) If fdr IsNot Nothing Then e.Table.DataTable.AddUserStyle(t & r & c,Color.White, Color.FromArgb(fdr("颜色"))) e.Table.DataTable.styles(t & r & c).ForeColor = Color.FromArgb(fdr("颜色")) e.style = t & r & c End If 报错内容: 错误事件:表,人员编制及到位人员,Drawcell 调用的目标发生异常 未将对象引用设置到对象的实例 [此贴子已经被作者于2017/10/6 12:41:47编辑过]
|
-- 作者:有点甜 -- 发布时间:2017/10/6 15:51:00 -- 在顶部加上代码
If e.Row.IsGroup OrElse e.Row.index < 0 Then Return |