[DevExpress]控件-checkboxlist之运用

ERP-易飞
易飞ERP系统运维、二次开发、实施
厦门德仔

数据绑定:

            string strSql = "SELECT [UserName],[Mail] FROM [OA].[dbo].[DZ_Users]";
            DataTable dt = new DataTable();
            dt = DbHelperSQL.Query(strSql.ToString()).Tables[0];


            chklboxL.DataSource = dt;
            chklboxL.DisplayMember = "UserName";
            chklboxL.ValueMember = "Mail";


            this.checkedComboBoxEdit1.Properties.DataSource = dt;
            this.checkedComboBoxEdit1.Properties.DisplayMember = "UserName";
            this.checkedComboBoxEdit1.Properties.ValueMember = "Mail";

            checkedComboBoxEdit1.EditValue = "test1@zettlercn.com,test2@zettlercn.com";     //默认值

获取:

       string mail = string.Empty;
            DataRowView value = chklboxL.SelectedValue as DataRowView;
            BaseCheckedListBoxControl.CheckedItemCollection checkboxs = chklboxL.CheckedItems;
            foreach (DataRowView item in checkboxs)
            {
                string name = item["UserName"].ToString();
                mail += item["Mail"].ToString() + ",";
            }
            XtraMessageBox.Show(mail.Substring(0, mail.Length - 1), "警告");

效果:



展开阅读全文
©️2020 CSDN 皮肤主题: 鲸 设计师: meimeiellie 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值