Dev_GridView:使用PopupContainerControl实现下拉树形列表

要使用 DevExpress 实现下拉列表树,需要使用三个控件结合才可以实现

PopupContainerEdit、PopupContainerControl、TreeList

设置控件 PopupContainerEdit 属性

PopupControl 设置要绑定到 PopupContainerEdit 控件中的 PopupContainerControl

设置控件 TreeList 属性

Dock 设置 TreeList  在控件 PopupContainerControl 中的填充方式

OptionsBehavior   

// 设置选中的节点是否可以编辑

Editable = False

OptionsSelection 

// 返回或设置是否允许用户可以对活动单元的外观进行调整

EnableAppearanceFocusedCell = False

OptionsView 

// 设置是否显示列头

ShowColumns = False

// 设置用户是否可以对行或列进行调整 

ShowIndicator = False

ListView 事件 FocusedNodeChanged 获取节点值

TreeListNode node = e.Node

popupContainerEdit.Tag = node["xx"].ToString();

popupContainerEdit.EditValue = node[0].ToString();

popupContainerEdit.ClosePopup();

//设置在显示控件 PopupContainerControl 时和控件 PopupContainerEdit  宽度保持一致

PopupContainerEdit 事件 QueryPopUp 

PopupContainerEdit popupedit = (PopupContainerEdit)sender;

popupContainer.Width = popupedit.Width;
---------------------

转载自:https://blog.csdn.net/haoqingbin_1125/article/details/19807483

猜你喜欢

转载自www.cnblogs.com/Alex1994/p/10031811.html
今日推荐