MS
This commit is contained in:
@@ -416,81 +416,93 @@ Public Class ClassWindreamDocGrid
|
||||
End Sub
|
||||
|
||||
Private Shared Sub gridView_CustomColumnDisplayText(sender As Object, e As CustomColumnDisplayTextEventArgs)
|
||||
Dim view As ColumnView = sender
|
||||
Dim parsedDate As DateTime
|
||||
Try
|
||||
Dim view As ColumnView = sender
|
||||
Dim parsedDate As DateTime
|
||||
|
||||
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")
|
||||
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)
|
||||
|
||||
If e.Value.ToString() = String.Empty Then
|
||||
e.DisplayText = ""
|
||||
Exit Sub
|
||||
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
|
||||
|
||||
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")
|
||||
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
|
||||
End Sub
|
||||
|
||||
Public Shared Sub gridView_MasterRowExpanded(sender As GridView, e As DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs)
|
||||
ClassWindreamDocGrid.GetDocItems(sender)
|
||||
Dim GW As GridView = sender
|
||||
If SELECTED_DOC_ID = 0 Then
|
||||
MsgBox("Sorry no document was selected! Please try again!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim detailView As GridView = sender.GetDetailView(e.RowHandle, e.RelationIndex)
|
||||
With detailView.Columns
|
||||
'Spalten ausblenden
|
||||
.Item("GUID").Visible = False
|
||||
.Item("DocID").Visible = False
|
||||
.Item("CONFIG_ID").Visible = False
|
||||
.Item("LANGUAGE").Visible = False
|
||||
.Item("COLUMN_VIEW").Visible = False
|
||||
.Item("EDITABLE").Visible = False
|
||||
.Item("TYPE_ID").Visible = False
|
||||
.Item("VISIBLE").Visible = False
|
||||
|
||||
'Spalten formatieren
|
||||
|
||||
.Item("CHANGED_WHEN").DisplayFormat.FormatType = FormatType.DateTime
|
||||
.Item("CHANGED_WHEN").DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
.Item("HEADER_CAPTION").Caption = "Beschreibung"
|
||||
.Item("VALUE").Caption = "Wert"
|
||||
.Item("CHANGED_WHEN").Caption = "Geändert Wann"
|
||||
.Item("CHANGED_WHO").Caption = "Geändert Wer"
|
||||
Else
|
||||
.Item("HEADER_CAPTION").Caption = "Description"
|
||||
.Item("VALUE").Caption = "Value"
|
||||
.Item("CHANGED_WHEN").Caption = "Changed when"
|
||||
.Item("CHANGED_WHO").Caption = "changed Who"
|
||||
Try
|
||||
ClassWindreamDocGrid.GetDocItems(sender)
|
||||
Dim GW As GridView = sender
|
||||
If SELECTED_DOC_ID = 0 Then
|
||||
MsgBox("Sorry no document was selected! Please try again!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
End With
|
||||
If Not IsNothing(GW.GridControl.ContextMenuStrip.Name) Then
|
||||
If GW.GridControl.ContextMenuStrip.Name = "cmsResultFilesBasic" Then
|
||||
detailView.OptionsBehavior.Editable = False
|
||||
Else
|
||||
detailView.OptionsBehavior.Editable = True
|
||||
|
||||
Dim detailView As GridView = sender.GetDetailView(e.RowHandle, e.RelationIndex)
|
||||
With detailView.Columns
|
||||
'Spalten ausblenden
|
||||
.Item("GUID").Visible = False
|
||||
.Item("DocID").Visible = False
|
||||
.Item("CONFIG_ID").Visible = False
|
||||
.Item("LANGUAGE").Visible = False
|
||||
.Item("COLUMN_VIEW").Visible = False
|
||||
.Item("EDITABLE").Visible = False
|
||||
.Item("TYPE_ID").Visible = False
|
||||
.Item("VISIBLE").Visible = False
|
||||
|
||||
'Spalten formatieren
|
||||
|
||||
.Item("CHANGED_WHEN").DisplayFormat.FormatType = FormatType.DateTime
|
||||
.Item("CHANGED_WHEN").DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
.Item("HEADER_CAPTION").Caption = "Beschreibung"
|
||||
.Item("VALUE").Caption = "Wert"
|
||||
.Item("CHANGED_WHEN").Caption = "Geändert Wann"
|
||||
.Item("CHANGED_WHO").Caption = "Geändert Wer"
|
||||
Else
|
||||
.Item("HEADER_CAPTION").Caption = "Description"
|
||||
.Item("VALUE").Caption = "Value"
|
||||
.Item("CHANGED_WHEN").Caption = "Changed when"
|
||||
.Item("CHANGED_WHO").Caption = "changed Who"
|
||||
End If
|
||||
End With
|
||||
If Not IsNothing(GW.GridControl.ContextMenuStrip.Name) Then
|
||||
If GW.GridControl.ContextMenuStrip.Name = "cmsResultFilesBasic" Then
|
||||
detailView.OptionsBehavior.Editable = False
|
||||
Else
|
||||
detailView.OptionsBehavior.Editable = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
AddHandler detailView.CustomRowCellEdit, AddressOf detailView_CustomRowCellEdit
|
||||
AddHandler detailView.CustomRowCellEdit, AddressOf detailView_CustomRowCellEdit
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected error in gridView_MasterRowExpanded: " & ex.Message, False, False)
|
||||
MsgBox("Unexpected error in gridView_MasterRowExpanded: " & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Public Class WindreamDocGridComboboxItem
|
||||
|
||||
Reference in New Issue
Block a user