Private Sub GridView1_RowCellStyle(sender As Object, e As
RowCellStyleEventArgs) Handles GridView1.RowCellStyle
Try
If IsDBNull(e.CellValue) Then
e.Appearance.BackColor = Color.LightYellow
End If
Dim selectedCells As GridCell() = GridView1.GetSelectedCells()
isRowSelected = GridView1.IsRowSelected(e.RowHandle)
For Each Cells In selectedCells
If GridView1.GetSelectedCells.Count = 1 Then
If IsDBNull(GridView1.GetRowCellValue(Cells.RowHandle,
Cells.Column)) Then
e.Appearance.BackColor = Color.LightYellow
End If
Else
If isRowSelected Then
If IsDBNull(GridView1.GetRowCellValue(Cells.RowHandle,
Cells.Column)) Then
e.Appearance.BackColor = Color.FromArgb(226, 234,
253)
End If
End If
End If
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
XtraGrid中細胞和行選擇使用的DevExpress的WinForms Vb.net
我使用的DevExpress。我聲明「的DBNull的價值應該是「Lightyellow'.After默認顏色我想成爲選擇行或「DbNull」值中的單元格更改藍色。我做錯了什麼? 我想要選擇單元格或行來改變顏色(即null值)
什麼應該變成藍色?整排,還是那個細胞? – greenTree
被選中的行或單元格將被更改爲藍色(即Null值也是) –