C# DEV PopupContainerEdit和PopupContainerControll

来源:互联网 发布:乐高电机有哪些端口 编辑:程序博客网 时间:2024/06/01 15:37

http://www.zhegufei.com/post/23.html

  首先拖动一个PopupContainerEdit控件和PopupContainerControl控件到界面上,在PopupContainerControl中拖动一个TreeList控件,设置TreeList控件的OptionsView属性,我的设置为

image                                          image

设置TreeList控件的OptionsView属性                              设置TreeList的OptionsSelection属性: 

image                                                        image

设置TreeList的OptionsBehavior属性,使其不可编辑:          然后设置PopupContainerEdit的PopControl属性

                                                                                                    使其与PopupContainerControl组件关联

为TreeList添加FocusedNodeChanged事件

C#代码  

private void treeList2_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e)  

{  

       TreeListNode node = e.Node;  

            popupContainerEdit1.Tag = node["xxxx"].ToString();  

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

            popupContainerEdit1.ClosePopup();  

}  

选择之后便可关闭弹出框。

image

补充:为了能让PopupContainerControl和PopupContainerEdit的宽度保持一致,需要在PopupContainerEdit上添加QueryPopUp事件处理:

private void popupContainerEdit1_QueryPopUp(object sender, CancelEventArgs e)  

{  

      PopupContainerEdit popupedit = (PopupContainerEdit)sender;  

      popupContainerControl1.Width = popupedit.Width;  



Gridview绑定PopupContainerEdit和PopupContainerControll 代码如下:

RepositoryItemContainerEdit Items=new RepositoryItemContainerEdit();

设置gridview列的ColumnEdit绑定tems

Items的PopupControl属性绑定 PopupContainerControl 容器即可



0 0
原创粉丝点击