protected override object CreateControlCore(){
            var helper=new CriteriaPropertyEditorHelper(MemberInfo);
            

            var controlHelper = new FilterEditorControlHelper(_application, _objectSpace);
            var filterControl = new FilterEditorControl(() =>{
                var criteriaObjectType = helper.GetCriteriaObjectType(CurrentObject);
                return Model.Application.BOModel.GetClass(criteriaObjectType).AllMembers.Cast<IModelMemberFullTextContains>();
            });
            controlHelper.Attach(filterControl);
            filterControl.AllowCreateDefaultClause = false;
            filterControl.FilterChanged += (sender, args) => OnControlValueChanged();
            filterControl.FilterTextChanged += (sender, args) => OnControlValueChanged();
            return filterControl;
        }
        protected override object CreateControlCore()
        {
            var helper = new CriteriaPropertyEditorHelper(MemberInfo);


            var controlHelper = new FilterEditorControlHelper(_application, _objectSpace);
            var filterControl = new FilterEditorControl(() => {
                var criteriaObjectType = helper.GetCriteriaObjectType(CurrentObject);
                return(Model.Application.BOModel.GetClass(criteriaObjectType).AllMembers.Cast <IModelMemberFullTextContains>());
            });

            controlHelper.Attach(filterControl);
            filterControl.AllowCreateDefaultClause = false;
            filterControl.FilterChanged           += (sender, args) => OnControlValueChanged();
            filterControl.FilterTextChanged       += (sender, args) => OnControlValueChanged();
            return(filterControl);
        }
Exemple #3
0
        private void gridControl_HandleCreated(object sender, EventArgs e)
        {
            ((Forms.Control)sender).HandleCreated -= gridControl_HandleCreated;
            var filterEditorControl = new Editors.FilterEditorControl(() => View.Model.ModelClass.AllMembers.Cast <IModelMemberFullTextContains>());
            var helper = new FilterEditorControlHelper(Application, ObjectSpace);

            helper.Attach(filterEditorControl);
            _filterControl        = (XpandFilterControl)filterEditorControl.FilterControl;
            _filterControl.Height = 150;
            _filterControl.Dock   = ((IModelListViewFilterControlSettings)View.Model).FilterControlPosition;
            _filterControl.UseMenuForOperandsAndOperators = false;
            _filterControl.AllowCreateDefaultClause       = false;
            AssignControlDatasource(filterEditorControl);

            OnCustomAssignFilterControlSourceControl(e);
            var gridControl      = AssignLookAndFeel(sender);
            var criteriaFromView = GetCriteriaFromView();

            _filterControl.FilterString = criteriaFromView;

            var accept = new SimpleButton {
                Text = CaptionHelper.GetLocalizedText(XpandSystemWindowsFormsModule.XpandWin,
                                                      "AcceptFilter")
            };

            accept.Click += ((o, args) => ((WinColumnsListEditor)View.Editor).ColumnView.ActiveFilterCriteria = _filterControl.FilterCriteria);
            accept.Dock   = Forms.DockStyle.Bottom;
            _filterControl.Controls.Add(accept);

            if (gridControl.Parent != null)
            {
                gridControl.Parent.Controls.Add(_filterControl);
            }
            else
            {
                gridControl.ParentChanged += gridControl_ParentChanged;
            }
            OnFilterControlCreated(EventArgs.Empty);
        }