以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  单元格标色  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=134732)

--  作者:blackzhu
--  发布时间:2019/5/5 14:18:00
--  单元格标色
Dim t As Table = Tables(TableName)
        Dim i As Integer = 0
        For Each r As Row In t.Rows
            Select Case r("项目状态")
                Case "已开单"
                    Dim cr1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("a")
                    cr1.BackColor = Color.White
                    cr1.ForeColor = Color.Red
                    t.Grid.SetCellStyle(i, 2, cr1)
end select


这样写有问题吗?发现有的颜色颜色没有出来,有的颜色判断修改的颜色不对!
[此贴子已经被作者于2019/5/5 14:19:23编辑过]

--  作者:有点甜
--  发布时间:2019/5/5 14:26:00
--  
Dim t As Table = Tables("表A")
For Each r As Row In t.Rows
    Select Case r("第一列")
        Case "11"
            Dim cr1 As C1.Win.C1FlexGrid.CellStyle = t.Grid.Styles.Add("a")
            cr1.BackColor = Color.White
            cr1.ForeColor = Color.Red
            t.Grid.SetCellStyle(r.Index+t.HeaderRows, 2, cr1)
    End Select
Next