Search This Blog
Wednesday, September 9, 2015
How to reset View customizations made by end-users (UPDATE)
I invite you to test an updated version of the previous E1897 solution (it is now marked as obsolete), which we are planning to include in v15.2 by default. The new solution supports both WinForms and ASP.NET apps and also works for both the root and nested Views (e.g., the ones embedded into ListPropertyEditor and DetailPropertyEditor):
Testing
To test this new solution in the current v15.1, include this C# source file into YourSolutionName.Module project (vb.net guys can either use this approach OR convert this code into their language using free tools).
Poll question
I also have a question to you: what is the best location for the Reset View Settings command?
1. In a separate Tools sub-menu (one per root form);
2. In the toolbar accompanying each View (may be too noisy);
3. Suggest other locations and demonstrate them with screenshots (e.g., context menu).
I am looking forward to hearing from you.
Subscribe to:
Post Comments (Atom)
Good stuff, cheers Dennis.
ReplyDeleteI'd say in a context menu whilst right clicking the header.
Thanks! What about non-grid ListView without headers as well as DetailView? If possible, please illustrate your answer with screenshots.
DeleteHey Dennis,
ReplyDeletei think in context menu of column header is the best solution! I can add colums at this place end finally reset my view! Thanks!!
Thanks, Jens! Am I correct that you do not need this reset functionality for DetailView and non-grid ListView?
Deletegive me a sample for non-grid listviews?! did you mean scheduler or someone?
DeleteDetailview can currently reset in contextmenu of layoutcontrol. it's ok!
Yes, scheduler, pivot, charts, etc.
DeleteAs for the DetailView, you're right about the existing layout control's context menu. I was primarily interested in having a universal "reset" command available for any View. As far as I interpreted your answer, you do not need new options except for the context menu in grids, correct?
yes, the grid functionality would perfect in header menu. for detailview the current solution is enough.
DeleteThanks for taking the time to answer, Jens. I appreciate it.
DeleteOption number 1.
ReplyDeleteContext menu, the one that lets you add and hide columns.
ReplyDeleteNice work!
ReplyDeleteSometimes when you make some customization to the grid, and have some data error, it starts showing errors messages when you click on the grid, so putting the reset view on context menu could be non accessible.
I'd prefer option 1.
Hi Dennis,
ReplyDeleteMy vote for context menu on both list and detail views.
What about Master detail ones ?
Regards,
Marcelo.
Hi Marcelo,
DeletePlease clarify your problem with this solution and master detail Views. Thanks.
Option 1 and context menu of column header.
ReplyDeleteThank you Dennis for the solution provided. Unfortunately, I have a problem when a criteria is set via model (standard model, during developement). In this case, the criteria is not applied again after the reset. It is somehow wrong, because the standard criteria is imposed by the programmer.
ReplyDelete@Ufo: I could not replicate this behavior using the latest XAF v16.2.4 and its built-in ResetViewSettings Action. If you are already on XAF v15.2.4+, do NOT use the custom Controller mentioned above and instead use the built-in feature. If you experience any difficulties with it, please report the repro steps using the https://www.devexpress.com/Support/Center/Question/Create service. Thanks.
DeleteHi Dennis! I'm using v13.1.5 and I can't update version soon, unfortunately. I can submit a ticket for my version, but I suppose v13 is too old to obtain proper support... The solution provided here does almost everything I need, except for the reset of the criteria...
Delete(by the way, I don't use an action. Instead, I've modified the contextual menu of the ListView.)
DeleteThanks for your clarification. Yes, you are correct that we do not provide a solution for this particular task for such an old version except for the workaround code I posted above, which will also be unable to support due to the availability of a better solution in the most recent XAF versions. For now, I can only recommend you install the latest XAF trial and inspect/grab the source code of the standard ResetViewSettingsController class. Take special note that once you copy its code into your project, you will need to modify/comment out certain features like CustomGetTotalTooltip, CustomGetFormattedConfirmationMessage, etc., which are unavailable in the old XAF versions. Let me know in case of any further difficulties.
DeleteAs for the context menu, thanks for informing us of your preferences.