为什么记录窗口中第一列用代码设置颜色之后,预览单击设置颜色的单元格,单元格颜色就变成和没有设置过的一样,但是第二列设置颜色之后却是正常的
Dim cmd1 As new SQLCommand
Dim dt1 As DataTable
cmd1.C
cmd1.CommandText = " select * fro m 单据模板表 where 表名 = '物料表' and 是否必填 = 1"
dt1 = cmd1.ExecuteReader()
Dim t As Table = rg.Table
Dim g As object = rg.basecontrol
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = g.Styles.Add("样式1")
cs1.backcolor = Color.LemonChiffon
For Each r2 As object In g.rows
For Each c As Col In t.cols
If c.Name = r2(0) Then ''''''''c.Caption = r2(0) Then
For Each r1 As DataRow In dt1.DataRows
If c.Name = r1("字段") Then
g.SetCellStyle(r2.index, 0, cs1)
End If
Next
End If
Next
Next
[此贴子已经被作者于2016/10/31 16:36:44编辑过]