Current filter:
                                You should refresh the page.

                                How to customize the settings of a toolbar item created for an Action.

                                0

                                See the How to: Customize Controls Associated with an Action for more details.

                                IMPORTANT NOTES
                                Take special note that if you use RibbonUI.Win module in your solution (before 10.1) you will need to handle the corresponding event of the DevExpress.ExpressApp.RibbonUI.Win.Templates.ActionContainers.RibbonBarActionItemsFactory class instead of the default DefaultBarActionItemsFactory one.

                                See Also:
                                How to create custom action type with custom control (BarCheckItem), associated with it

                                You must  log in  or  register  to leave comments
                                Select file
                                • MyFilterController.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2012 vol 1.4 - v2012 vol 2.8
                                • v2011 vol 2.5 - v2011 vol 2.14
                                • v2011 vol 1.4 - v2011 vol 1.12
                                • v2010 vol 2.3 - v2010 vol 2.11
                                • v2010 vol 1.4 - v2010 vol 1.12
                                • v2009 vol 1.2 - v2009 vol 3.7
                                • v2008 vol 3.3
                                using System;
                                using DevExpress.XtraBars;
                                using DevExpress.ExpressApp;
                                using DevExpress.Data.Filtering;
                                using DevExpress.Persistent.Base;
                                using DevExpress.ExpressApp.Actions;
                                using DevExpress.XtraEditors.Repository;
                                using DevExpress.ExpressApp.Win.Templates;
                                using DevExpress.ExpressApp.Win.Templates.ActionContainers;
                                
                                namespace AccessActionControl.Module.Win {
                                    public partial class MyFilterController : ViewController {
                                        private ParametrizedAction parametrizedAction1;
                                        public MyFilterController() {
                                            TargetViewType = ViewType.ListView;
                                            TargetObjectType = typeof(MyDomainObject);
                                            parametrizedAction1 = new ParametrizedAction(
                                                this, "My Date Filter", PredefinedCategory.Search, typeof(DateTime));
                                            parametrizedAction1.Caption = "My Date Filter";
                                            parametrizedAction1.Execute += parametrizedAction1_Execute;
                                        }
                                
                                        void parametrizedAction1_Execute(object sender, ParametrizedActionExecuteEventArgs e) {
                                            CriteriaOperator criterion = null;
                                            if (e.ParameterCurrentValue != null && e.ParameterCurrentValue.ToString() != string.Empty) {
                                                criterion = new BinaryOperator("CreatedOn",
                                                    Convert.ToDateTime(e.ParameterCurrentValue));
                                            }
                                            ((ListView)View).CollectionSource.Criteria[parametrizedAction1.Id] = criterion;
                                        }
                                        protected override void OnFrameAssigned() {
                                            BarActionItemsFactory.CustomizeActionControl += DefaultBarActionItemsFactory_CustomizeActionControl;
                                        }
                                        protected override void OnDeactivated() {
                                            BarActionItemsFactory.CustomizeActionControl -= DefaultBarActionItemsFactory_CustomizeActionControl;
                                            base.OnDeactivated();
                                        }
                                        private void DefaultBarActionItemsFactory_CustomizeActionControl(
                                            object sender, CustomizeActionControlEventArgs e) {
                                            if (e.Action.Id == parametrizedAction1.Id) {
                                                BarEditItem barItem = (BarEditItem)e.ActionControl.Control;
                                                barItem.Width = 170;
                                                RepositoryItemDateEdit repositoryItem = (RepositoryItemDateEdit)barItem.Edit;
                                                repositoryItem.Mask.UseMaskAsDisplayFormat = true;
                                                repositoryItem.Mask.EditMask = "yyyy-MMM-dd";
                                                repositoryItem.NullText = "Enter date";
                                            }
                                        }
                                    }
                                }