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.ExpressApp.Editors
Imports DevExpress.ExpressApp.Win
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.Data.Filtering

Public Class RegistryRowsFinancialControllingVC
    Inherits DevExpress.ExpressApp.ViewController
    '###################################################################################################################################
    '############################Ez a controller a RegistryRowsFinancialControlling típusra van irányítva!##############################
    '###################################################################################################################################
    Public Sub New()
        MyBase.New()

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

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

        '-- a controlling lookupeditorjának elkapása a registryrowsfinancialcontrolling_detailview-n, hogy meg lehessen szûrni a lookuplistview-t (csak kiadás vagy nem beállított jöhet fel)
        Dim _ControllingLookupEditor As PropertyEditor = TryCast(View, DetailView).FindItem("Controlling")
        AddHandler TryCast(_ControllingLookupEditor, LookupPropertyEditor).Control.Popup, AddressOf lookuppropertyeditor_popup
    End Sub
    Private Sub lookuppropertyeditor_popup(sender As Object, e As EventArgs)
        TryCast(sender, LookupEdit).PopupForm.ListView.CollectionSource.Criteria.Remove("ControllingFilter")
        TryCast(sender, LookupEdit).PopupForm.ListView.CollectionSource.Criteria.Add("ControllingFilter", CriteriaOperator.Parse("Controllingdirection In (1, -1)"))
    End Sub
End Class
