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
私は選択したいLightyellow'.After」内のデフォルトの色でなければなりませんDevExpress社は「DbNullに」の値を宣言する.I使用していますxtragridセルおよび行の選択
行またはセルを「DbNull」値に設定して、青色を変更します。私は何を間違えたのですか? 色を変更するセルまたは行を選択したい(そのnull値も)
青色に変更する必要はありますか?行全体、またはそのセルだけ? – greenTree
選択した行またはセルを青色に変更します(そのNull値も) –