Esempio n. 1
0
        private void gridView1_ShowFilterPopupCheckedListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupCheckedListBoxEventArgs e)
        {
            if (e.Column.FieldName != "orderPrice")
            {
                return;
            }

            e.CheckedComboBox.SelectAllItemVisible = false;

            for (int i = 0; i < e.CheckedComboBox.Items.Count; i++)
            {
                CheckedListBoxItem item      = e.CheckedComboBox.Items[i];
                Decimal            itemValue = (decimal)(item.Value as FilterItem).Value;
                if (itemValue == 8 || itemValue == 10)
                {
                    e.CheckedComboBox.Items[i].Enabled = false;
                }
            }
        }
        private void gvDrawings_ShowFilterPopupCheckedListBox(object sender, FilterPopupCheckedListBoxEventArgs e)
        {
            if (e.Column == colStandartSize)
            {
                var items = new List<CheckedListBoxItem>();

                for (int i = 0; i < e.CheckedComboBox.Items.Count; i++)
                {
                    var item = e.CheckedComboBox.Items[i];
                    if (item.Value != null)
                    {
                        items.Add(item);
                    }
                }

                items = items.OrderBy(item => item.Value.ToString(), new StandartSizeComparer()).ToList();
                e.CheckedComboBox.Items.Clear();
                e.CheckedComboBox.Items.AddRange(items.ToArray());
            }
        }