Dev 官网连接
TreeList
PopupContainerControl
PopupContainerEdit
效果图:

添加一个组件 开始自定义控件

文件结构

Entity Code
using System;
namespace Test
{
public class DataDto
{
public Guid Id {
get; set; }
public Guid ParentId {
get; set; }
public string Name {
get; set; }
public string Value {
get; set; }
}
}
Event Code:
using System;
using System.Collections.Generic;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.Repository;
namespace Test
{
public partial class ComponentName : PopupContainerControl
{
// 控制清除 确定 取消 三个按钮的显示
public bool showCancelButton = true;
public bool showOKButton = false;
public bool showClearButton = false;
private bool firstLoad = true;
private List<DataDto> ListData {
get; set; }
public DataDto Current {
get; set; }
public event Action<DataDto> ChangeValue;
protected PopupContainerEdit edit;
private RepositoryItemPopupContainerEdit PopupControl {
get; set; }
public ComponentName()
{
this.InitializeComponent();
this.btnCancel.Visible = this.showCancelButton;
this.btnClear.Visible = this.showClearButton;
this.btnOK.Visible = this.showOKButton;
this.ListData = new List<DataDto>();
this.PopupControl = new RepositoryItemPopupContainerEdit
{
TextEditStyle = TextEditStyles.Standard,
PopupControl = this
};
this.PopupControl.Popup += PopupControl_Popup;
this.PopupContainerProperties.ShowPopupCloseButton = false;
this.PopupContainerProperties.PopupWidthMode = PopupWidthMode.UseEditorWidth;
this.PopupControl.BeforePopup += PopupControl_BeforePopup;
this.PopupControl.Closed +

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



