Imports DevExpress.XtraGrid Imports DevExpress.XtraGrid.Views.Grid Public Class ClassGridControl Public Shared Sub DefaultGridSettings(grid As GridControl) For Each oView In grid.Views If TypeOf oView Is GridView Then DefaultGridViewSettings(oView) End If Next End Sub Public Shared Sub ReadOnlyGridSettings(grid As GridControl) For Each oView In grid.Views If TypeOf oView Is GridView Then ReadonlyGridViewSettings(oView) End If Next End Sub Public Shared Sub CheckboxSelectGridSettings(grid As GridControl) For Each oView In grid.Views If TypeOf oView Is GridView Then CheckboxSelectGridViewSettings(oView) End If Next End Sub ''' ''' Set a view to readonly ''' Private Shared Sub ReadonlyGridViewSettings(ByRef View As GridView) View.OptionsBehavior.Editable = False View.OptionsBehavior.ReadOnly = True End Sub ''' ''' Set view Multiselect with checkboxes ''' Private Shared Sub CheckboxSelectGridViewSettings(ByRef View As GridView) View.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CheckBoxRowSelect View.OptionsSelection.MultiSelect = True End Sub ''' ''' Set default settings for view ''' Private Shared Sub DefaultGridViewSettings(ByRef View As GridView) View.OptionsView.ShowAutoFilterRow = True ' Color Settings View.OptionsView.EnableAppearanceEvenRow = True View.Appearance.EvenRow.BackColor = Color.Aquamarine View.Appearance.FilterPanel.BackColor = Color.Orange AddHandler View.RowStyle, AddressOf GridView_RowStyle End Sub Private Shared Sub GridView_RowStyle(sender As Object, e As RowStyleEventArgs) If e.RowHandle = GridControl.AutoFilterRowHandle Then e.Appearance.BackColor = Color.LightSalmon End If End Sub End Class