Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text

Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.XtraFilterEditor
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.XtraEditors
Imports DevExpress.ExpressApp.Editors
Imports DevExpress.Data.Filtering

Public Class ViewFilterContainerVC
    Inherits SISBusiness.Module.ViewFilterContainerVC

    Public Sub New()
        MyBase.New()

        'This call is required by the Component Designer.
        InitializeComponent()
        RegisterActions(components)

    End Sub
    Protected Overrides Sub OnViewControlsCreated()
        MyBase.OnViewControlsCreated()

        If View.Id = "ViewFilterContainer_DetailView" Then
            Dim _CriteriaPropertyEditor As CriteriaPropertyEditor = TryCast(View, DetailView).FindItem("Criteria")
            If _CriteriaPropertyEditor IsNot Nothing Then
                Dim _FilterEditorControl As FilterEditorControl = TryCast(_CriteriaPropertyEditor.Control, FilterEditorControl)

                _FilterEditorControl.Font = New System.Drawing.Font("Arial", 12, System.Drawing.FontStyle.Bold)
                _FilterEditorControl.ViewMode = FilterEditorViewMode.Visual
            End If
        End If
        If View.Id = "ViewFilterContainer_ViewFilterContainerSaved_ListView" Then
            CType(View, ListView).CollectionSource.Criteria("ByUser") = CriteriaOperator.Parse("IsPublic=? or UserCreated.UserName=?", True, SecuritySystem.CurrentUserName)
        End If

    End Sub
End Class
