Common/GridBuilder: add SetDateTimeColumns for TreeList
This commit is contained in:
parent
8870ccf7c6
commit
5ee5fa6d1b
@ -5,6 +5,7 @@ Imports DevExpress.Utils
|
|||||||
Imports DevExpress.XtraGrid.Columns
|
Imports DevExpress.XtraGrid.Columns
|
||||||
Imports DevExpress.XtraGrid.Views.Grid
|
Imports DevExpress.XtraGrid.Views.Grid
|
||||||
Imports DevExpress.XtraTreeList
|
Imports DevExpress.XtraTreeList
|
||||||
|
Imports DevExpress.XtraTreeList.Columns
|
||||||
|
|
||||||
Public Class GridBuilder
|
Public Class GridBuilder
|
||||||
Private ReadOnly EvenRowBackColor = Color.Gainsboro
|
Private ReadOnly EvenRowBackColor = Color.Gainsboro
|
||||||
@ -81,12 +82,36 @@ Public Class GridBuilder
|
|||||||
ToList()
|
ToList()
|
||||||
|
|
||||||
For Each oDateCol In oDateColumns
|
For Each oDateCol In oDateColumns
|
||||||
oDateCol.DisplayFormat.FormatType = FormatType.Custom
|
SetDateTimeColumn(oDateCol)
|
||||||
oDateCol.DisplayFormat.FormatString = "g"
|
|
||||||
oDateCol.DisplayFormat.Format = DateTimeFormatInfo.CurrentInfo
|
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub SetDateTimeColumns(pTreeList As TreeList)
|
||||||
|
If pTreeList.Columns Is Nothing Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim oDateColumns = pTreeList.Columns.AsEnumerable.
|
||||||
|
Where(Function(column As TreeListColumn) column.ColumnType = GetType(Date)).
|
||||||
|
ToList()
|
||||||
|
|
||||||
|
For Each oDateCol In oDateColumns
|
||||||
|
SetDateTimeColumn(oDateCol)
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SetDateTimeColumn(pColumn As GridColumn)
|
||||||
|
pColumn.DisplayFormat.FormatType = FormatType.Custom
|
||||||
|
pColumn.DisplayFormat.FormatString = "g"
|
||||||
|
pColumn.DisplayFormat.Format = DateTimeFormatInfo.CurrentInfo
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SetDateTimeColumn(pColumn As TreeListColumn)
|
||||||
|
pColumn.Format.FormatType = FormatType.Custom
|
||||||
|
pColumn.Format.FormatString = "g"
|
||||||
|
pColumn.Format.Format = DateTimeFormatInfo.CurrentInfo
|
||||||
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Applies common properties to all GridViews
|
''' Applies common properties to all GridViews
|
||||||
''' </summary>
|
''' </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user