5 Commits

Author SHA1 Message Date
Jonathan Jenne
0e51eec9b1 Patterns: Replace with empty string for lookup edits when editvalid is nothing 2022-07-15 09:36:24 +02:00
Jonathan Jenne
8e47ba31e7 Common/SQLEditor: reverse placeholder order, remove placeholder title bar 2022-07-15 09:35:34 +02:00
Jonathan Jenne
ad3de3caa6 merge 2022-07-15 09:34:49 +02:00
Jonathan Jenne
45b6534f48 Common: Version 1.13.5.0 2022-07-13 15:31:05 +02:00
Jonathan Jenne
b4fa36469d GridBuilder: Add SetDateTimeColumns 2022-07-13 15:30:49 +02:00
5 changed files with 36 additions and 11 deletions

View File

@@ -1,5 +1,8 @@
Imports System.Drawing
Imports System.Globalization
Imports System.Windows.Forms
Imports DevExpress.Utils
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraTreeList
@@ -64,6 +67,26 @@ Public Class GridBuilder
Next
End Sub
''' <summary>
''' Applies a proper datetime format string to all columns of the view.
''' </summary>
''' <remarks>The view's columns need to be loaded for this to work!</remarks>
Public Sub SetDateTimeColumns(pView As GridView)
If pView.Columns Is Nothing Then
Exit Sub
End If
Dim oDateColumns = pView.Columns.AsEnumerable.
Where(Function(column As GridColumn) column.ColumnType = GetType(Date)).
ToList()
For Each oDateCol In oDateColumns
oDateCol.DisplayFormat.FormatType = FormatType.Custom
oDateCol.DisplayFormat.FormatString = "g"
oDateCol.DisplayFormat.Format = DateTimeFormatInfo.CurrentInfo
Next
End Sub
''' <summary>
''' Applies common properties to all GridViews
''' </summary>
@@ -198,4 +221,5 @@ Public Class GridBuilder
e.Handled = True
End If
End Sub
End Class

View File

@@ -84,9 +84,8 @@ Partial Class frmSQLEditor
'
'
'
Me.GalleryPlaceholders.Gallery.ColumnCount = 4
Me.GalleryPlaceholders.Gallery.ColumnCount = 6
Me.GalleryPlaceholders.Gallery.Images = Me.SvgImageCollection1
Me.GalleryPlaceholders.Gallery.ShowGroupCaption = True
Me.GalleryPlaceholders.Gallery.ShowItemText = True
Me.GalleryPlaceholders.Id = 1
Me.GalleryPlaceholders.Name = "GalleryPlaceholders"
@@ -259,7 +258,7 @@ Partial Class frmSQLEditor
'
'GridPlaceholders
'
Me.GridPlaceholders.Anchor = System.Windows.Forms.AnchorStyles.Right
Me.GridPlaceholders.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridPlaceholders.Location = New System.Drawing.Point(0, 0)
Me.GridPlaceholders.MainView = Me.ViewPlaceholders
Me.GridPlaceholders.MenuManager = Me.RibbonControl1

View File

@@ -136,7 +136,4 @@
LDQgIGw0LTRsMywzbC00LDRMMjMsMjB6IiBjbGFzcz0iUmVkIiAvPg0KPC9zdmc+Cw==
</value>
</data>
<metadata name="SvgImageCollection1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -106,10 +106,7 @@ Public Class frmSQLEditor
End Sub
Private Function LoadPlaceholders() As List(Of GalleryItemGroup)
Dim oPlaceholders = New List(Of GalleryItemGroup)() From {
Placeholders.GetInternalPlaceholders(),
Placeholders.GetUserPlaceholders()
}
Dim oPlaceholders = New List(Of GalleryItemGroup)()
Dim oAutomaticAttributes = Placeholders.GetAutomaticPlaceholders(PlaceholdersAutomatic, PlaceholdersAutomaticPrefix, PlaceholdersAutomaticTitle)
If oAutomaticAttributes IsNot Nothing Then
@@ -130,6 +127,9 @@ Public Class frmSQLEditor
oPlaceholders.Add(Placeholders.GetClipboardPlaceholder)
End If
oPlaceholders.Add(Placeholders.GetUserPlaceholders())
oPlaceholders.Add(Placeholders.GetInternalPlaceholders())
Return oPlaceholders
End Function

View File

@@ -52,7 +52,12 @@ Namespace Modules
Case GetType(DevExpress.XtraEditors.LookUpEdit)
Dim oLookupEdit As DevExpress.XtraEditors.LookUpEdit = oControl
oReplaceValue = oLookupEdit.EditValue
If IsNothing(oLookupEdit.EditValue) Then
oReplaceValue = String.Empty
Else
oReplaceValue = oLookupEdit.EditValue
End If
Case GetType(LookupControl3)
Dim oLookupControl3 As LookupControl3 = oControl