Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to save the currently opened View as a new View Variant at runtime

$
0
0

This example provides reusable UserViewVariants modules that allow your end-users to add View Variants dynamically. Refer to the Best practices of creating reusable XAF modules by example of a View Variants module extension blog post for more information. See functional tests for the implemented functionality in the UserViewVariants\Functional Tests\E2813.ets file.


IMPORTANT NOTES
Due to the application model generation specifics on the Web it makes sense to use this solution on the Web only if you store your end-user model differences in the database: How to store users' model differences separately for each user in the database.


See also:

ViewVariants - provide the capability to save the current view as a new view variant and share it with other users at runtime

Question Comments

Added By: Robert Fuchs at: 9/2/2013 1:36:24 PM    

Modified today but still not for 13.1 !?
Why?

Added By: Dennis (DevExpress Support) at: 9/3/2013 12:16:43 AM    

Robert, this example was already available for version 13.1 before today. Today was just a maintenance update without much changes.

Added By: Robert Fuchs at: 9/3/2013 10:12:12 AM    

Thanks Dennis.
Interestingly the version combo didn't show 13.1 yesterday.
I downloaded it anyway and it worked in 13.1 after changing .Net FW type to 4.

Added By: Richard Jones_1 at: 12/11/2013 1:04:47 PM    

Hello, This is a great solution, but after upgrading to 13.2 it does not compile, Do you have a version for 13.2?
Thanks
Richard

Added By: Nektarios Patelis at: 12/13/2013 12:35:47 AM    

waiting upgrade for 13.2

Added By: Willem de Vries at: 1/8/2014 8:49:14 AM    

Just leaving a comment to be included in any update messages. Waiting for a remedy for this breaking change to be able to upgrade to 13.2 with many of my applications.

Added By: Tony Tadros at: 1/14/2014 9:52:19 AM    

i have a suggestion to support such functionality of of the box

Added By: Stefan Tschiharz at: 1/23/2014 12:38:29 AM    

Could the example be updated to 13.2.6?

Added By: Dennis (DevExpress Support) at: 1/23/2014 12:41:45 AM    

Guys, please refer to my answer in Q554368 (there you can find an updated version + a link to a hot fix build).

Added By: Kanapol W. at: 1/29/2014 7:58:02 AM    

Right now, I have upgrade to v2013 vol 2.5
I use the most update code in "v2013 vol 1.4- v2013 vol1.9" . It get the error.
Would you please update this example to work with the most update version?

Added By: Dennis (DevExpress Support) at: 1/29/2014 8:01:21 AM    

@Kanapol: This example will be updated once the version 13.2.7 is out (in a week or so). In the meantime, please check out my previous comment for a solution. Thanks.

Added By: Tony Tadros at: 12/23/2014 2:35:17 AM    

Hello Devexpress ,

i have a need to use this module with a small change
i want to have 2 types of variants System,UserDefined for the system ones it should prevent users doing any changes on layout
or to discard changes after user closes current view

if i extended the IModelVariant with the property Type {System,User Defined}how to use this property to after

Thanks & Regards
Tony

Added By: Dennis (DevExpress Support) at: 12/23/2014 8:45:51 AM    

@Tony: You can update the availability of the 'editViewVariantItem' and 'removeViewVariantItem' ChoiceActionItem objects of the Action based on your variant type information via the ChoiceActionItem.Active property:

 

This update can be done from within the UpdateUserViewVariantsAction method or on other events as you prefer.
As for discarding changes to a View, handle the View.ModelSaving event and set the Cancel parameter to True depending on your conditions. While we do not have a ready sample or guidelines for this particular customization, do not hesitate to contact us if you experience any difficulties using the XAF API I suggested above.

Added By: PTLab at: 6/29/2015 3:45:52 AM    

Dennis, it's very interesting example, thank you. I tested this solution in my project, that have implementation of storing user model in database. All One user modifications stored in database, but Other user have all One's modifications after login. Whats wrong, and how realy separate changes?

Added By: Dennis (DevExpress Support) at: 6/29/2015 6:31:30 AM    

@PTLab: Thanks for your feedback. To process your recent post more efficiently, I created a separate ticket on your behalf: T261243: E2813 and model differences stored in the database. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Mysoft Systems at: 1/7/2016 8:47:35 AM    

Great Feature

Added By: Dennis (DevExpress Support) at: 1/8/2016 2:34:39 AM    @Mysoft Systems: Thanks for your feedback. Would you please elaborate a bit more on the main functionality you are planning to implement for your project? With that, we can consider updates to this example or our built-in ViewVariants module to suit your business needs better. Thanks in advance.Added By: Paul Kubb at: 1/8/2016 2:39:02 AM    

@Dennis,  May I join that? I have a certain business requirement about this too, which I still have no idea how to go.

Added By: Dennis (DevExpress Support) at: 1/8/2016 2:51:21 AM    

@Paul: Sure, we will be more than happy to learn more on your business requirements as well and support you with technical solutions. It's best to submit this info in a separate ticket as well.
As far as I understand, this is related to ViewVariants - How to show the ChangeVariant Action even for a single View variant where you have left a comment recently.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>