Common: Show Grid in Property Dialog
This commit is contained in:
@@ -4,6 +4,9 @@ Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Controls.LookupGrid
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports System.Windows.Forms
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
|
||||
Public Class PropertyControls
|
||||
Private _LogConfig As LogConfig
|
||||
@@ -16,53 +19,72 @@ Public Class PropertyControls
|
||||
_Db = Database
|
||||
End Sub
|
||||
|
||||
Public Function GetControlForAttribute(Attribute As Attribute) As BaseEdit
|
||||
Select Case Attribute.TypeName
|
||||
Case "BIT"
|
||||
Public Function GetControlForAttribute(pAttribute As Attribute, pIsReadOnly As Boolean) As Control
|
||||
Dim oControl As Control
|
||||
|
||||
Select Case pAttribute.TypeName
|
||||
Case Attribute.TYPE_BIT
|
||||
Dim oCheckboxEdit As New CheckEdit With {
|
||||
.Name = Attribute.ID,
|
||||
.Text = Attribute.Title
|
||||
.Name = pAttribute.ID,
|
||||
.Text = pAttribute.Title,
|
||||
.[ReadOnly] = pIsReadOnly
|
||||
}
|
||||
Return oCheckboxEdit
|
||||
oControl = oCheckboxEdit
|
||||
|
||||
Case "DATE"
|
||||
Case Attribute.TYPE_DATE
|
||||
Dim oDateEdit As New DateEdit With {
|
||||
.Name = Attribute.ID
|
||||
.Name = pAttribute.ID,
|
||||
.[ReadOnly] = pIsReadOnly
|
||||
}
|
||||
Return oDateEdit
|
||||
oControl = oDateEdit
|
||||
|
||||
Case "BIG INTEGER"
|
||||
Case Attribute.TYPE_BIG_INTEGER
|
||||
Dim oTextEdit As New TextEdit With {
|
||||
.Name = Attribute.ID
|
||||
.Name = pAttribute.ID,
|
||||
.[ReadOnly] = pIsReadOnly
|
||||
}
|
||||
Return oTextEdit
|
||||
oControl = oTextEdit
|
||||
|
||||
Case "DECIMAL"
|
||||
Case Attribute.TYPE_DECIMAL
|
||||
Dim oTextEdit As New TextEdit With {
|
||||
.Name = Attribute.ID
|
||||
.Name = pAttribute.ID,
|
||||
.[ReadOnly] = pIsReadOnly
|
||||
}
|
||||
Return oTextEdit
|
||||
oControl = oTextEdit
|
||||
|
||||
Case "FLOAT"
|
||||
Case Attribute.TYPE_FLOAT
|
||||
Dim oTextEdit As New TextEdit With {
|
||||
.Name = Attribute.ID
|
||||
.Name = pAttribute.ID,
|
||||
.[ReadOnly] = pIsReadOnly
|
||||
}
|
||||
Return oTextEdit
|
||||
oControl = oTextEdit
|
||||
|
||||
Case "VECTOR STRING"
|
||||
Dim oLookupEdit As New LookupControl2 With {
|
||||
.Name = Attribute.ID,
|
||||
.MultiSelect = True,
|
||||
.[ReadOnly] = True
|
||||
Case Attribute.TYPE_VECTOR_STRING
|
||||
' Minimum size is picked up by the LayoutControl to determine the grids size
|
||||
Dim oGrid As New GridControl With {
|
||||
.Name = pAttribute.ID,
|
||||
.MinimumSize = New System.Drawing.Size(0, 100)
|
||||
}
|
||||
Return oLookupEdit
|
||||
|
||||
oGrid.ForceInitialize()
|
||||
|
||||
Dim oView = DirectCast(oGrid.DefaultView, GridView)
|
||||
oView.OptionsView.ShowGroupPanel = False
|
||||
oView.OptionsView.ShowColumnHeaders = False
|
||||
oView.OptionsView.ShowIndicator = False
|
||||
oView.OptionsBehavior.ReadOnly = True
|
||||
oView.OptionsBehavior.Editable = False
|
||||
oControl = oGrid
|
||||
|
||||
Case Else
|
||||
Dim oTextEdit As New TextEdit With {
|
||||
.Name = Attribute.ID
|
||||
.Name = pAttribute.ID,
|
||||
.[ReadOnly] = pIsReadOnly
|
||||
}
|
||||
Return oTextEdit
|
||||
oControl = oTextEdit
|
||||
|
||||
End Select
|
||||
|
||||
Return oControl
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user