public Main()
        {
            InitializeComponent();
            FilterColumnCollection columns = new FilterColumnCollection();

            columns.Add(new UnboundFilterColumn("Order ID", "OrderID", typeof(int), spinEdit, FilterColumnClauseClass.Generic));
            columns.Add(new UnboundFilterColumn("Product", "Product", typeof(string), textEdit, FilterColumnClauseClass.String));
            columns.Add(new UnboundFilterColumn("Discount", "Discount", typeof(decimal), spinEdit, FilterColumnClauseClass.Generic));
            filterControl.SetFilterColumnsCollection(columns);
            filterControl.FilterCriteria = CriteriaOperator.Parse("Product between ('Alice Munton', 'Icura') && Discount > .05");
            filterControl.SetDefaultColumn(filterControl.FilterColumns["OrderID"]);
        }
Ejemplo n.º 2
0
 public FilterColumnCollectionBuilder <TEntity> AddColumn <T>(Expression <Func <TEntity, T> > expression,
                                                              DevExpress.XtraEditors.Repository.RepositoryItem repositoryItem = null,
                                                              FilterColumnClauseClass clauseClass = FilterColumnClauseClass.String, string caption = null)
 {
     if (repositoryItem == null)
     {
         if (typeof(T) == typeof(bool) || (typeof(T) == typeof(bool?)))
         {
             repositoryItem = EditorHelpers.CreatEdit <RepositoryItemCheckEdit>();
             clauseClass    = FilterColumnClauseClass.Generic;
         }
         if ((typeof(T) == typeof(double)) || (typeof(T) == typeof(double?)) || (typeof(T) == typeof(decimal)) || (typeof(T) == typeof(decimal?)))
         {
             repositoryItem = EditorHelpers.CreatEdit <RepositoryItemSpinEdit>();
             clauseClass    = FilterColumnClauseClass.Generic;
         }
         if (typeof(T) == typeof(int) || (typeof(T) == typeof(int?)))
         {
             var spinEdit = EditorHelpers.CreatEdit <RepositoryItemSpinEdit>();
             spinEdit.IsFloatValue = false;
             repositoryItem        = spinEdit;
             clauseClass           = FilterColumnClauseClass.Generic;
         }
     }
     filterColumns.Add(CreateColumn(expression, caption, null, repositoryItem, clauseClass));
     return(this);
 }
        private DevExpress.XtraEditors.Filtering.FilterColumnCollection createFilterColumn(IClientRuleQueryBase clientRuleObject, DevExpress.XtraEditors.Filtering.FilterColumnCollection orgFilterColumns)
        {
            var vals = clientRuleObject.UIRuleXmlConfigInfo.GetDefaultColumns();
            List <MB.WinBase.Common.ColumnPropertyInfo> cols = new List <MB.WinBase.Common.ColumnPropertyInfo>();

            cols.AddRange(vals.Values.ToArray());
            cols.Sort(new Comparison <MB.WinBase.Common.ColumnPropertyInfo>(colPropertyOrderByIndex));

            DevExpress.XtraEditors.Filtering.FilterColumnCollection filterColumns = new FilterColumnCollection();
            foreach (var colInfo in cols)
            {
                if (!colInfo.AdvanceFilter || !colInfo.Visibled)
                {
                    continue;
                }

                var fCol = getFilterColumn(orgFilterColumns, colInfo.Name);
                if (fCol == null)
                {
                    continue;
                }

                filterColumns.Add(fCol);
            }
            return(filterColumns);
        }
Ejemplo n.º 4
0
        public override void InitDataFilter()
        {
            FilterColumnCollection columns = new FilterColumnCollection();

            columns.Add(new UnboundFilterColumn("Partner Id", "PartnerId", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));
            this.FilterControl.SetFilterColumnsCollection(columns);
            base.InitDataFilter();
        }
        private FilterColumnCollection GetFilterColumnsCollection(List <PropertyDescriptor> td)
        {
            FilterColumnCollection filterCollection = new FilterColumnCollection();

            foreach (PropertyDescriptor pd in td)
            {
                CustomFilterColumn UFC = new CustomFilterColumn(pd.DisplayName, pd.Name,
                                                                pd.PropertyType, GetDefaultEditor(pd.PropertyType), GetClauseClass(pd.PropertyType), this);
                filterCollection.Add(UFC);
            }
            return(filterCollection);
        }
        public override void InitDataFilter()
        {
            //FilterColumnCollection filterColumns = FilterColumns.ArHistory();
            base.InitDataFilter();
            FilterColumnCollection filterColumns = new FilterColumnCollection();

            filterColumns.Add(new UnboundFilterColumn("Group ID", "CustId", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));
            filterColumns.Add(new UnboundFilterColumn("Delegate Area", "Area", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));
            filterColumns.Add(new UnboundFilterColumn("Group City", "City", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));
            filterColumns.Add(new UnboundFilterColumn("Group State", "Region", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));
            filterColumns.Add(new UnboundFilterColumn("Start Payment Date", "PmtDateFrom", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));
            filterColumns.Add(new UnboundFilterColumn("End Payment Date", "PmtDateThru", typeof(string), new RepositoryItemTravTextBox(), FilterColumnClauseClass.String));

            this.FilterControl.SetFilterColumnsCollection(filterColumns);
        }
Ejemplo n.º 7
0
 public FilterColumnCollectionBuilder <TEntity> AddColumn <T>(Expression <Func <TEntity, T> > expression,
                                                              DevExpress.XtraEditors.Repository.RepositoryItem repositoryItem = null, FilterColumnClauseClass clauseClass = FilterColumnClauseClass.String)
 {
     filterColumns.Add(CreateColumn(expression, null, null, repositoryItem, clauseClass));
     return(this);
 }
Ejemplo n.º 8
0
        public BookFilterEditor(TCommonFireBirdDB db)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            InitializeComponent();

            firstActivate = true;
            database = db;

            FilterColumnCollection columnCollection = new FilterColumnCollection();

            genreEditor = new RepositoryItemGridLookUpEdit();
            genreEditor.ValueMember = "Name";
            genreEditor.DisplayMember = "Name";
            genreEditor.ViewType = GridLookUpViewType.Default;

            GridColumn genreNameColumn = new GridColumn();
            genreNameColumn.Caption = "Name";
            genreNameColumn.FieldName = "Name";
            genreNameColumn.VisibleIndex = 0;

            GridColumn genreDescColumn = new GridColumn();
            genreDescColumn.Caption = "Description";
            genreDescColumn.FieldName = "RuDescription";
            genreDescColumn.VisibleIndex = 1;

            genreEditor.View.Columns.Add(genreNameColumn);
            genreEditor.View.Columns.Add(genreDescColumn);

            columnCollection.Add(new UnboundFilterColumn("Genre", "Genres", typeof(string), this.genreEditor, FilterColumnClauseClass.String));
            columnCollection.Add(new UnboundFilterColumn("Language", "Lang", typeof(string), new RepositoryItemComboBox(), FilterColumnClauseClass.String));
            columnCollection.Add(new UnboundFilterColumn("Source Language", "SrcLang", typeof(string), new RepositoryItemComboBox(), FilterColumnClauseClass.String));
            columnCollection.Add(new UnboundFilterColumn("Book Author", "BookAuthors", typeof(string), new RepositoryItemComboBox(), FilterColumnClauseClass.String));

            this.filterControl.SetFilterColumnsCollection(columnCollection);
        }