Common: Add Support for TreeList in GridBuilder
This commit is contained in:
parent
f3e7090a01
commit
dd2ed7d6a0
@ -1,7 +1,10 @@
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports System.Drawing
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraTreeList
|
||||
|
||||
Public Class GridBuilder
|
||||
Private ReadOnly EvenRowBackColor = Color.Gainsboro
|
||||
|
||||
Public ReadOnly Property Views As New List(Of GridView)
|
||||
|
||||
Public Sub New(GridView As GridView)
|
||||
@ -26,9 +29,23 @@ Public Class GridBuilder
|
||||
''' <summary>
|
||||
''' Applies common properties to the supplied GridView
|
||||
''' </summary>
|
||||
Public Function WithDefaults(GridView As GridView)
|
||||
Public Function WithDefaults(GridView As GridView) As GridBuilder
|
||||
GridView.OptionsView.EnableAppearanceEvenRow = True
|
||||
GridView.OptionsView.ShowAutoFilterRow = True
|
||||
GridView.Appearance.EvenRow.BackColor = EvenRowBackColor
|
||||
GridView.Appearance.EvenRow.Options.UseBackColor = True
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Applies common properties to the supplied TreeList
|
||||
''' </summary>
|
||||
Public Function WithDefaults(TreeList As TreeList) As GridBuilder
|
||||
TreeList.OptionsView.EnableAppearanceEvenRow = True
|
||||
TreeList.OptionsView.ShowAutoFilterRow = True
|
||||
TreeList.Appearance.EvenRow.BackColor = EvenRowBackColor
|
||||
TreeList.Appearance.EvenRow.Options.UseBackColor = True
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
@ -53,4 +70,14 @@ Public Class GridBuilder
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Applies read-only properties to the supplied TreeList
|
||||
''' </summary>
|
||||
Public Function WithReadOnlyOptions(TreeList As TreeList) As GridBuilder
|
||||
TreeList.OptionsBehavior.Editable = False
|
||||
TreeList.OptionsBehavior.ReadOnly = True
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user