CheckedComboBoxEdit 全選之后,修改文本框所顯示的內容


     private void checkedComboBoxEdit1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e)
        {
            string items = checkedComboBoxEdit1.Properties.GetCheckedItems().ToString(); List<string> checkItems = new List<string>(); if (items.Contains(",")) { string[] itemValue = items.Split(','); foreach (string i in itemValue) { checkItems.Add(i); } } if (checkItems != null) { if (checkItems.Count() == checkedComboBoxEdit1.Properties.Items.Count) { e.DisplayText = "ALL"; } } }

效果如下:

修改前:

修改后: 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM