Current filter:
                                You should refresh the page.
                                  • How can I hide the All Items and Unassigned Items categories in the Bar Customisation form?

                                    I have some items that I don't want users to be able to move during customisation, in the VCL version of the bars component I could create a hidden category and add the items to that, but with All Items being available in the WPF version I can't prevent the item being moved.

                                    Many thanks.

                                • Andrey Marten (DevExpress Support) 07.08.2016

                                  Hello Simon,

                                  Please give us additional time. We will update this thread as soon as we have any news.

                                  Thanks,
                                  Andrey

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Simon,

                                To hide the "All Items" and "Unassigned Items" items in the Customization window, you need to override the BarManagerCustomizationHelper class and exclude these items from the collection that is returned by the InitializeCategories method:

                                [C#]
                                public class MyCustomizationHelper : BarManagerCustomizationHelper { protected override IEnumerable<BarManagerCategory> InitializeCategories() { return base.InitializeCategories().Where(x => x.Name != "All Items" && x.Name != "Unassigned Items"); } }

                                To use this helper instead of our standard one, you need to override the implementation of the CustomizationDecorator (and its CreateCustomizationHelper method), and create a custom CustomizationService class, which implements the ICustomizationService interface. Use all these classes to register your helper:

                                [C#]
                                static MainWindow() { BarNameScope.RegisterDecorator<CustomizationDecorator, ICustomizationService>( () => new MyCustomizationDecorator(), decorator => new MyCustomizationService(decorator), () => new MyCustomizationService(null)); }

                                I've attached a simple sample, which illustrates the main idea of the approach. Take a moment to review it and let me know of your results.

                                Simon, I've also forwarded your note about the behavior of the same window in VCL to our developers, so that they can take this information into account in the future. Thank you for pointing this out.

                                Thanks,
                                Andrey

                                • Simon Craythorn 07.11.2016

                                  That worked perfectly.  Thank you.

                                • Andrey Marten (DevExpress Support) 07.11.2016

                                  You are welcome, Simon!
                                  Andrey