zoukankan      html  css  js  c++  java
  • 使用PopupContainerEdit和PopupContainerControl制作下拉菜单树小记(转)

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


                                          
     

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



     


                                                      

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

                                                                                                        使其与PopupContainerControl组件关联



     为TreeList添加FocusedNodeChanged事件

    C#代码  收藏代码
    1. private void treeList2_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e)  
    2. {  
    3.        TreeListNode node = e.Node;  
    4.             popupContainerEdit1.Tag = node["xxxx"].ToString();  
    5.             popupContainerEdit1.EditValue = node[0].ToString();  
    6.             popupContainerEdit1.ClosePopup();  
    7. }  

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

     

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

    C#代码  收藏代码
    1. private void popupContainerEdit1_QueryPopUp(object sender, CancelEventArgs e)  
    2. {  
    3.       PopupContainerEdit popupedit = (PopupContainerEdit)sender;  
    4.       popupContainerControl1.Width = popupedit.Width;  
    5. }  
  • 相关阅读:
    jQuery检测滚动条(scroll)是否到达底部
    sql group by
    hbm.xml 详解总结
    net.sf.json 时间格式的转化
    经典SQL语句大全
    HashTable
    in与exist , not in与not exist 的区别
    网页布局常用的一些命名规则和书写
    什么是SOA?
    sql之left join、right join、inner join的区别
  • 原文地址:https://www.cnblogs.com/zzh1236/p/2591354.html
Copyright © 2011-2022 走看看