London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Remove Edit from Selection Factory

Vote:
0

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:
1

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
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.