private List <CheckComboBoxItem> GetItems()
        {
            List <CheckComboBoxItem> items = new List <CheckComboBoxItem>();

            for (int i = 0, count = 50; i < count; i++)
            {
                string id   = string.Format("Id-{0}", i);
                string text = string.Format("Text-{0}", i);
                var    item = new CheckComboBoxItem
                {
                    Id      = id,
                    Text    = text,
                    IsCheck = false,
                };

                //if (i % 4 == 0)
                //{
                //    item.IsCheck = true;
                //}

                items.Add(item);
            }

            return(items);
        }
Esempio n. 2
0
        private void checkComboBox1_CheckStateChanged(object sender, EventArgs e)
        {
            CheckComboBoxItem checkboxitem = sender as CheckComboBoxItem;

            foreach (DevExpress.XtraGrid.Columns.GridColumn column in gridView1.Columns)
            {
                if (column.FieldName == checkboxitem.Value)
                {
                    column.Visible = checkboxitem.CheckState;
                    return;
                }
            }
        }