zoukankan      html  css  js  c++  java
  • CheckedComboxEdit

    绑定方法1:追加Items的方式(建议采用绑定方式)

    //清空项
                checkedComboBoxEdit1.Properties.Items.Clear();
    
                checkedComboBoxEdit1.Properties.Items.Add(1, "新建");
                checkedComboBoxEdit1.Properties.Items.Add(2, "审批中");
                checkedComboBoxEdit1.Properties.Items.Add(3, "已完成");
                checkedComboBoxEdit1.Properties.Items.Add(4, "已撤销");
    
                foreach (DevExpress.XtraEditors.Controls.CheckedListBoxItem cbi in this.checkedComboBoxEdit1.Properties.Items)
                {
                    if (cbi.Value.Equals(2) || cbi.Value.Equals(1))
                    {
                        cbi.CheckState = CheckState.Checked;
                    }
                }
    

    绑定方法2:绑定数据源的方式(注意这种绑定方式,Popup事件里才可以获取this.checkedComboBoxEdit1.Properties.Items的真实数值,并且无法设置具体项目的CheckState)

                List<DepartmentInfo> list_departments = new List<DepartmentInfo>();
                list_departments = DataFactory.GetDepartmentList();
                this.checkedComboBoxEdit1.Properties.DataSource = list_departments;
                this.checkedComboBoxEdit1.Properties.DisplayMember = "DepartmentName";
                this.checkedComboBoxEdit1.Properties.ValueMember = "DepartmentID";
    

      

  • 相关阅读:
    1-4-Java 语言环境搭建
    1-3-JDK,JRE,JVM介绍
    1-2-java语言的特点及运行机制
    1-1-常用DOS命令与快捷键
    0-2-计算机硬件介绍
    一、JSP的3大指令Page,include,taglib
    springboot目录结构
    问题:qt按钮有时候点击没有反应
    vs2017+qt问题
    mysql问题
  • 原文地址:https://www.cnblogs.com/volts0302/p/6950833.html
Copyright © 2011-2022 走看看