Remove Edit from Selection Factory

Vote:
 

Hey all!

Next to selection factory list items there are options to Edit, Move Up, Move Down and Delete. Is there a built in attribute or other way to remove Edit option to particular selection factory? Screenshot attached:



Cheers!

#264675
Edited, Oct 07, 2021 10:48
Vote:
 

Hi,

You can use a custom editor descriotor and override the GridDefinition commands to not include "Edit" as an option. Something like below. Please note i have not tested the below code. But it should work.

[EditorDescriptorRegistration(TargetType = typeof(IList<MyCustomProperty>))]
public class MyCustomEditorDescriptor : CollectionEditorDescriptor<MyCustomProperty>
    {
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);
            var commands = base.GridDefinition.Commands - CollectionEditorCommands.Edit;
            metadata.EditorConfiguration.Add("commands", (object) commands );
        }
    }

~ Sujit

#264690
Edited, Oct 07, 2021 16:33
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.