RepositoryItemPopupContainerEdit.PopupControl Property
Gets or sets the control to display in the popup window.
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v24.2.dll
Declaration
[DefaultValue(null)]
[DXCategory("Data")]
public virtual PopupContainerControl PopupControl { get; set; }
Property Value
Type | Default | Description |
---|---|---|
PopupContainerControl | null | A PopupContainerControl control to display in the popup window. |
Remarks
To specify the content of a PopupContainerEdit editor’s popup window, first create a PopupContainerControl control. This control represents the panel which serves as the container for visual controls. Place the desired controls onto the container and assign it to the PopupControl property. The panel’s content will be displayed when the editor’s popup window is invoked.
Note: the size of the assigned control specifies the popup window’s initial size. You can stop users from changing the window’s size by using the RepositoryItemPopupContainerEdit.PopupSizeable property.
Example
The following example creates a PopupContainerControl with a RichTextBox inside, and assigns this control to a PopupContainerEdit editor.
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.ViewInfo;
using System;
using System.Data;
using System.Windows.Forms;
namespace DXApplication10 {
public partial class Form1 : DevExpress.XtraEditors.XtraForm {
public Form1() {
InitializeComponent();
// ...
this.Load += Form1_Load;
}
private void Form1_Load(object sender, EventArgs e) {
CreatePopupEditor();
}
void CreatePopupEditor() {
RichTextBox rtb = new RichTextBox();
rtb.Dock = DockStyle.Fill;
PopupContainerControl popupControl = new PopupContainerControl();
popupControl.Controls.Add(rtb);
PopupContainerEdit editor = new PopupContainerEdit();
editor.Location = new Point(100, 30);
editor.Width = 350;
editor.Properties.PopupControl = popupControl;
Controls.Add(editor);
editor.Closed += (s, a) => {
(s as PopupContainerEdit).EditValue = rtb.Text;
};
editor.CustomDisplayText += (s, x) => {
if (x.Value != null)
x.DisplayText = x.Value.ToString().TrimStart(' ', '\r', '\n');
};
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the PopupControl property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.