以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]整行颜色与预设的颜色冲突  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=163331)

--  作者:zhutangxin
--  发布时间:2021/4/23 14:44:00
--  [求助]整行颜色与预设的颜色冲突
问题如下,怎么解决?
表格样式都是默认样式,没有改变!

图片点击可在新窗口打开查看
[此贴子已经被作者于2021/4/23 15:03:42编辑过]

--  作者:有点蓝
--  发布时间:2021/4/23 15:04:00
--  
整行只有一种固定的样式。要变化就不要使用默认的整行模式,到drawcell里自己绘制整行的样式,判断一下当前行有没有使用其它样式,如果有就相应的处理
--  作者:zhutangxin
--  发布时间:2021/4/23 16:30:00
--  
drawcell事件中三个IF条件里增加了 AndAlso e.Table.Current.DataRow("id") <> e.Row.DataRow("id") 还是没有用。

e.Table.DataTable.AddUserStyle("blue1", Color.Blue, Color.White)

e.Table.DataTable.AddUserStyle("LightCyan", Color.LightCyan, Color.Black) \'Color.black)

e.Table.DataTable.AddUserStyle("Yellow", Color.LightYellow, Color.Black) \'Color.black)

If e.Row("battery") = "battery" AndAlso e.Table.Current.DataRow("id") <> e.Row.DataRow("id") Then  e.style = "LightCyan"

If e.Row("battery") = "DG" AndAlso e.Table.Current.DataRow("id") <> e.Row.DataRow("id") Then  e.style = "blue1"

If e.Row("battery").Tolower.EndsWith("ng") AndAlso e.Table.Current.DataRow("id") <> e.Row.DataRow("id") Then  e.style = "Yellow"

 

If e.Row("locationID").ToString = "Please confirm with OTR" Then

    e.style = "Yellow"

End If



--  作者:有点蓝
--  发布时间:2021/4/23 16:40:00
--  
If e.Row("battery") = "battery" Then
if e.row.index = e.table.rowsel then
e.style = "某整行样式"
else
  e.style = "LightCyan"
end if
endif

另外2个照样改

--  作者:zhutangxin
--  发布时间:2021/4/24 0:09:00
--  
谢谢,问题解决了