Validation and stuff
This commit is contained in:
@@ -247,23 +247,25 @@ Public Class frmRowEditor
|
||||
Private Sub GridView1_CustomDrawCell(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles GridView1.CustomDrawCell
|
||||
Dim oDataRow As DataRow = GridView1.GetDataRow(e.RowHandle)
|
||||
Dim oKey As String = oDataRow.Item(COL_KEY)
|
||||
|
||||
If e.Column.FieldName = COL_VALUE_FINAL Then
|
||||
Dim oColumn = _Table.Columns.
|
||||
Dim oValue As String = oDataRow.Item(COL_VALUE_FINAL)
|
||||
Dim oColumn = _Table.Columns.
|
||||
Where(Function(c) c.Name = oKey).
|
||||
SingleOrDefault()
|
||||
|
||||
If e.Column.FieldName = COL_VALUE_FINAL Then
|
||||
If oColumn Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
If oColumn.Config?.IsReadOnly Then
|
||||
e.Appearance.BackColor = Color.LightGray
|
||||
End If
|
||||
|
||||
If oColumn.Config?.IsReadOnly Then
|
||||
e.Appearance.BackColor = Color.LightGray
|
||||
If oColumn.Config?.IsRequired AndAlso e.CellValue.ToString.Length = 0 Then
|
||||
e.Appearance.BackColor = Color.LightCoral
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If (oColumn.IsRequired Or oColumn.Config?.IsRequired) AndAlso e.CellValue.ToString.Length = 0 Then
|
||||
e.Appearance.BackColor = Color.LightCoral
|
||||
End If
|
||||
If oColumn.Config?.IsRequired AndAlso oValue.ToString.Length = 0 Then
|
||||
e.Appearance.BackColor = Color.LightCoral
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user