If you set AllowNew to false, both the link and new buttons are missing
If you set AllowDelete to false, both the delete and unlink buttons are missing.
There are scenarios where it would not be desirable to allow add new or add delete but to still have link and unlink (as those are very independent types of activities).
Proposed Solution:
Allow for independent control of the link and unlink buttons.
SystemModules.Link - The AllowNew and AllowDelete attributes for the nested ListView should not impact the Link and Unlink actions
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
The IModelListView.AllowLink and IModelListView.AllowUnlink properties specify whether the associated objects can be linked and unlinked in the current Nested List View.
- v15.2.4Download Official Update
Hello Mark,
Thanks for posting the suggestion. As you probably know, we already had a similar discussion in the Support Center at "AllowDelete = false" Disables Unlink Action and also a great forum debates concerning the current behavior. We have to revisit this problem because I see that there are already several trackers and talks concerning this. We will get back to you as soon as we can.
>>There are scenarios where it would not be desirable to allow add new or add delete but to still have link and unlink (as those are very independent types of activities).
For now, if possible, please describe in greater detail when you need this functionality. This definitely will add more sense to your suggestion as well as helps us to reevaluate it better (the fact that we tend to accept and implement only those suggestion that have application in the a real world).
Thanks,
Dennis
Hi Mark,
>>For now, if possible, please describe in greater detail when you need this functionality. This definitely will add more sense to your suggestion as well as helps us to reevaluate it better (the fact that we tend to accept and implement only those suggestion that have application in the a real world).
Can you please comment?
See Also:
SystemModules.Delete - Usability of ListView that represents Many-To-Many collection
Thanks,
Dennis
I will give the specific project that was the cause for this suggestion.
Working on a traffic engineering system.
it has a class "location"
it also has a traffic signal controller class
As it stands there are multiple locations that can be controlled by one controller (thus a one to many association, with a locations collection on the controller class)
the use case calls for the ability to link and unlink locations as required, but it does not want users to create or delete locations at this point (mainly because the users were getting confused between unlink and delete and were accidentaly deleting locations {major problem})
please let me know if you would like more information
Mark
PS: I solved the problem by creating an interface with 4 methods (AllowAdd, AllowDelete, AllowLink, AllowUnlink)
Each method has two parameters: View ID, View Object Type and returns bool.
A controller for non-root listviews checks the CollectionSource.MasterObject for this interface and if present it sets the corresponding actions' active property to the result of the appropriate method call.
I like this solution because it allows me to control the logic at the business class level; where I feel it belongs.
Mark
Hello Mark,
Thanks for the updates and sharing your findings. Your scenario makes sense, and we would implement this suggestion. A question concerning a workaround you implemented - could you please provide your sample code here so that other users could benefit from it? Thanks for your help.
Thanks,
Dennis
I feel, when dealing with the security system, that the ability to write to the master object matters more in this scenario than if AllowNew/AllowDelete is permitted. You're not creating or deleting anything really when linking/unlinking, especially in a one to many… I consider it writing to the master.
Anyways, this one is currently biting me.