我是用dataSource的方式,增加行,然后触发的RowsAdded事件,然后改变Cell背景没效果
需求是改变某一列的Cell的背景色
- Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
- Dim detail_temp As New SOD0201Detail_DTDataTable
- For i As Integer = 1 To 5
- Dim row As ElTabelleDataSet.SOD0201Detail_DTRow = detail_temp.NewSOD0201Detail_DTRow()
- row.JUNRO = i
- detail_temp.AddSOD0201Detail_DTRow(row)
- Next
- boundDs.SOD0201Detail_DT.Merge(detail_temp)
- End Sub
- Private Sub GcMultiRow1_RowsAdded(ByVal sender As System.Object, ByVal e As GrapeCity.Win.MultiRow.RowsAddedEventArgs) Handles GcMultiRow1.RowsAdded
- Me.GcMultiRow1.Rows(1).Item(0).Style.BackColor = Color.Blue
- Me.GcMultiRow1.Rows(1).DefaultCellStyle.BackColor = Color.Red
- End Sub
复制代码 |