This commit is contained in:
2020-05-04 15:19:24 +02:00
parent 61602f42d5
commit 5097c2d595
9 changed files with 109 additions and 172 deletions

View File

@@ -439,35 +439,38 @@ Public Class ClassWindreamDocGrid
Try
Dim view As ColumnView = sender
Dim parsedDate As DateTime
If Not IsNothing(DATE_COLUMNS) Then
If DATE_COLUMNS.Contains(e.Column.FieldName) And e.ListSourceRowIndex <> DevExpress.XtraGrid.GridControl.InvalidRowHandle Then
If DATE_COLUMNS.Contains(e.Column.FieldName) And e.ListSourceRowIndex <> DevExpress.XtraGrid.GridControl.InvalidRowHandle Then
If e.Value.ToString() = String.Empty Then
e.DisplayText = ""
Exit Sub
End If
If Not DateTime.TryParse(e.Value, parsedDate) Then
parsedDate = DateTime.ParseExact(e.Value, CURRENT_DATE_FORMAT & " HH:MM:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo)
End If
e.DisplayText = parsedDate.ToString(CURRENT_DATE_FORMAT & " HH:MM:ss")
If e.Value.ToString() = String.Empty Then
e.DisplayText = ""
Exit Sub
End If
End If
If Not IsNothing(DATE_COLUMNS_CONFIG) Then
If DATE_COLUMNS_CONFIG.Contains(e.Column.FieldName) And e.ListSourceRowIndex <> DevExpress.XtraGrid.GridControl.InvalidRowHandle Then
If e.Value.ToString() = String.Empty Then
e.DisplayText = ""
Exit Sub
End If
If Not DateTime.TryParse(e.Value, parsedDate) Then
parsedDate = DateTime.ParseExact(e.Value, CURRENT_DATE_FORMAT & " HH:MM:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo)
If Not DateTime.TryParse(e.Value, parsedDate) Then
parsedDate = DateTime.ParseExact(e.Value, CURRENT_DATE_FORMAT, System.Globalization.DateTimeFormatInfo.InvariantInfo)
End If
e.DisplayText = parsedDate.ToString(CURRENT_DATE_FORMAT)
End If
e.DisplayText = parsedDate.ToString(CURRENT_DATE_FORMAT & " HH:MM:ss")
ElseIf DATE_COLUMNS_CONFIG.Contains(e.Column.FieldName) And e.ListSourceRowIndex <> DevExpress.XtraGrid.GridControl.InvalidRowHandle Then
If e.Value.ToString() = String.Empty Then
e.DisplayText = ""
Exit Sub
End If
If Not DateTime.TryParse(e.Value, parsedDate) Then
parsedDate = DateTime.ParseExact(e.Value, CURRENT_DATE_FORMAT, System.Globalization.DateTimeFormatInfo.InvariantInfo)
End If
e.DisplayText = parsedDate.ToString(CURRENT_DATE_FORMAT)
End If
Catch ex As Exception
ClassLogger.Add("Unexpected error in gridView_CustomColumnDisplayText: " & ex.Message, False, False)
MsgBox("Unexpected error in gridView_CustomColumnDisplayText: " & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub