Back to Devexpress

RepositoryItemPopupBase.BeforePopup Event

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitempopupbase-6af2fcdb.md

latest3.2 KB
Original Source

RepositoryItemPopupBase.BeforePopup Event

Fires when the editor’s popup is about to be displayed.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public virtual event EventHandler BeforePopup
vb
<DXCategory("Events")>
Public Overridable Event BeforePopup As EventHandler

Event Data

The BeforePopup event's data class is EventArgs.

Remarks

The BeforePopup event fires before the editor’s popup is displayed and allows you to customize the popup.

The following code snippet enables time editing in the DateEdit’s popup:

csharp
using DevExpress.XtraEditors.Popup;
using DevExpress.XtraEditors;
using DevExpress.Utils;
using System;

namespace DXApplication {
    public partial class Form1 : XtraForm {
        public Form1() {
            InitializeComponent();
            repositoryItemDateEdit1.BeforePopup += RepositoryItemDateEdit1_BeforePopup;
        }

        void RepositoryItemDateEdit1_BeforePopup(object sender, EventArgs e) {
            PopupDateEditForm popupForm = ((DateEdit)sender).GetPopupEditForm() as PopupDateEditForm;
            popupForm.Calendar.CalendarTimeEditing = DefaultBoolean.True;
        }
    }
}
vb
Imports DevExpress.XtraEditors.Popup
Imports DevExpress.XtraEditors
Imports DevExpress.Utils
Imports System

Namespace DXApplication
    Public Partial Class Form1
        Inherits XtraForm

        Public Sub New()
            InitializeComponent()
            AddHandler repositoryItemDateEdit1.BeforePopup, AddressOf RepositoryItemDateEdit1_BeforePopup
        End Sub

        Private Sub RepositoryItemDateEdit1_BeforePopup(sender As Object, e As EventArgs)
            Dim popupForm As PopupDateEditForm = CType(CType(sender, DateEdit).GetPopupEditForm(), PopupDateEditForm)
            popupForm.Calendar.CalendarTimeEditing = DefaultBoolean.True
        End Sub
    End Class
End Namespace

The PopupBaseEdit.BeforePopup event is equivalent to the BeforePopup event.

See Also

Popup

QueryPopUp

BeforePopup

RepositoryItemPopupBase Class

RepositoryItemPopupBase Members

DevExpress.XtraEditors.Repository Namespace