以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  修改行颜色问题-2  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=62918)

--  作者:qianqian1530
--  发布时间:2015/1/10 7:28:00
--  修改行颜色问题-2
两个问题  第一个

If e.Row("库存").Contains("▲") OrElse e.Row("库存").Contains("×")  Then
    e.Style = "警告"
End If
这么写的话,为什么是整个行的 颜色都会变呢, 我想要的是库存单元 改颜色.


第二个问题

Dim ndr As DataRow = DataTables("商品在庫表").AddNew
If e_Info.GetElementsByTagName("tr")(sa).GetAttribute("class") ="nyuka" \'水色
  
    
ElseIf e_Info.GetElementsByTagName("tr")(sa).GetAttribute("class") ="keppin" \'绿色
    
    
ElseIf e_Info.GetElementsByTagName("tr")(sa).GetAttribute("class") ="haiban" \'灰色
  
    
End If

当在网页上采集数据的时候,   class 包含相应的内容的话,  当前添加的行背景色就会改成红色.   这个怎么设置呢??

*我觉得不能用 e.Style    因为 上面的代码是在 全局里面设置的, 而且 class也不会添加到 新增行里面去...


--  作者:Bin
--  发布时间:2015/1/10 8:40:00
--  
1.

if e.col.name="库存" then
If e.Row("库存").Contains("▲") OrElse e.Row("库存").Contains("×")  Then
    e.Style = "警告"
End If
end if

2.同样在DrawCell判断设置




--  作者:qianqian1530
--  发布时间:2015/1/10 8:43:00
--  回复:(Bin)1.if e.col.name="库存" thenIf e.Row("...
我总不能把 采集的 程序 写到  DrawCell  里面去吧
--  作者:Bin
--  发布时间:2015/1/10 8:47:00
--  
肯定要添加,有依据才能判断显示.


如果你只是第一次采集的时候要显示颜色,以后不显示了
你可以用

Dim cs As C1.Win.C1FlexGrid.CellStyle = Tables("表A").grid.Styles.Add("test")
cs.font = new Font("宋体", 12, FontStyle.Bold Or FontStyle.Underline) \'字体
cs.backcolor = Color.red \'背景
cs.ForeColor = Color.blue \'字体颜色
Tables("表A").Grid.SetCellStyle(1,1,cs)

--  作者:qianqian1530
--  发布时间:2015/1/10 8:51:00
--  
这样啊,那只能添加个列来判断了..