LookupGrid: Fix Unsolicited opening of Popup, fix empty control
This commit is contained in:
parent
5c6d7296e1
commit
a0377c6c19
@ -30,10 +30,8 @@ Public Class LookupControl3
|
||||
RepositoryItemLookupControl3.RegisterLookupControl()
|
||||
End Sub
|
||||
|
||||
Public Sub New()
|
||||
End Sub
|
||||
|
||||
Private Sub InitializeComponent()
|
||||
Private Sub LookupControl3_EditValueChanging(sender As Object, e As ChangingEventArgs) Handles Me.EditValueChanging
|
||||
e.Cancel = True
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@ -41,10 +39,6 @@ End Class
|
||||
Public Class RepositoryItemLookupControl3
|
||||
Inherits RepositoryItemGridLookUpEdit
|
||||
|
||||
Public Sub PopupFIlter() Handles Me.BeforePopup
|
||||
|
||||
End Sub
|
||||
|
||||
Shared Sub New()
|
||||
RegisterLookupControl()
|
||||
End Sub
|
||||
@ -54,7 +48,6 @@ Public Class RepositoryItemLookupControl3
|
||||
End Sub
|
||||
|
||||
Private Const TAG_DROPDOWN = "openDropdown"
|
||||
|
||||
Private Const TAG_BUTTON_LOOKUP_FORM = "openLookupForm"
|
||||
|
||||
Private _R As Resources.ResourceManager = My.Resources.Strings.ResourceManager
|
||||
@ -69,8 +62,6 @@ Public Class RepositoryItemLookupControl3
|
||||
Public Delegate Sub SelectedValuesChangedHandler(sender As Object, SelectedValues As List(Of String))
|
||||
Public Event SelectedValuesChanged As SelectedValuesChangedHandler
|
||||
|
||||
Private _OriginalDatasource As DataTable
|
||||
|
||||
Public Overrides ReadOnly Property EditorTypeName As String
|
||||
Get
|
||||
Return CustomEditName
|
||||
@ -106,15 +97,6 @@ Public Class RepositoryItemLookupControl3
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Overloads Property Datasource As DataTable
|
||||
Get
|
||||
Return _OriginalDatasource
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
_OriginalDatasource = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Shared Sub RegisterLookupControl()
|
||||
Dim img As Image = Nothing
|
||||
Dim oClassInfo = New EditorClassInfo(
|
||||
@ -146,7 +128,8 @@ Public Class RepositoryItemLookupControl3
|
||||
FirstOrDefault()
|
||||
|
||||
If oButton IsNot Nothing Then
|
||||
oButton.Enabled = pVisible
|
||||
oButton.Visible = pVisible
|
||||
ActionButtonIndex = oButton.Index
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@ -177,7 +160,7 @@ Public Class RepositoryItemLookupControl3
|
||||
End Select
|
||||
Else
|
||||
NullText = Values.FirstOrDefault()
|
||||
OwnerEdit.EditValue = Values.FirstOrDefault()
|
||||
'OwnerEdit.EditValue = Values.FirstOrDefault()
|
||||
End If
|
||||
|
||||
_SelectedValues = Values
|
||||
@ -186,13 +169,20 @@ Public Class RepositoryItemLookupControl3
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub CreateDefaultButton()
|
||||
Dim oLookupFormButtonm = New EditorButton() With {
|
||||
.Kind = ButtonPredefines.Search,
|
||||
.Tag = TAG_BUTTON_LOOKUP_FORM,
|
||||
.Width = 25
|
||||
Dim oButtons As New List(Of EditorButton) From {
|
||||
New EditorButton() With {
|
||||
.Kind = ButtonPredefines.Search,
|
||||
.Tag = TAG_BUTTON_LOOKUP_FORM,
|
||||
.Width = 25
|
||||
},
|
||||
New EditorButton() With {
|
||||
.Kind = ButtonPredefines.Combo,
|
||||
.Tag = TAG_DROPDOWN,
|
||||
.Width = 25
|
||||
}
|
||||
}
|
||||
|
||||
Buttons.AddRange({oLookupFormButtonm})
|
||||
Buttons.AddRange(oButtons.ToArray)
|
||||
End Sub
|
||||
|
||||
Private Function GetLookupForm() As frmLookupGrid
|
||||
@ -200,7 +190,7 @@ Public Class RepositoryItemLookupControl3
|
||||
.MultiSelect = MultiSelect,
|
||||
.AddNewValues = AllowAddNewValues,
|
||||
.PreventDuplicates = PreventDuplicates,
|
||||
.DataSource = _OriginalDatasource,
|
||||
.DataSource = DataSource,
|
||||
.SelectedValues = SelectedValues,
|
||||
.StartPosition = FormStartPosition.Manual,
|
||||
.Location = OwnerEdit.PointToScreen(New Point(OwnerEdit.Width, 0))
|
||||
@ -248,11 +238,4 @@ Public Class RepositoryItemLookupControl3
|
||||
e.Cancel = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RepositoryItemLookupControl3_Popup(sender As Object, e As EventArgs) Handles Me.Popup
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user