Completed
Last Updated: 28 Nov 2017 06:45 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 21 Nov 2017 14:14
Category: PropertyGrid
Type: Bug Report
2
FIX. RadPropertyGrid - "Reset" and "Edit" items are missing from the context menu after collapsing and expanding a group
Please refer to the attached video illustrating the incorrect behavior of the context menu.

Workaround:

        public RadForm1()
        {
            InitializeComponent();

            this.radPropertyGrid1.SelectedObject = this;
            this.radPropertyGrid1.ToolbarVisible = true;

            this.radPropertyGrid1.RadContextMenu = new CustomPropertyGridDefaultContextMenu(this.radPropertyGrid1.PropertyGridElement.PropertyTableElement);
        }

        public class CustomPropertyGridDefaultContextMenu : Telerik.WinControls.UI.PropertyGridDefaultContextMenu
        {
            PropertyGridTableElement tableElement;

            public CustomPropertyGridDefaultContextMenu(PropertyGridTableElement propertyGridElement) : base(propertyGridElement)
            {
                tableElement = propertyGridElement;
            }

            protected override void OnDropDownOpening(CancelEventArgs args)
            {
                base.OnDropDownOpening(args);
                PropertyGridItemBase item = this.tableElement.SelectedGridItem;
                if (item != null)
                {
                    if (!(item is PropertyGridGroupItem))
                    {
                        this.EditMenuItem.Visibility = ElementVisibility.Visible;
                        this.ResetMenuItem.Visibility = ElementVisibility.Visible;
                    }
                }
            }
        }
0 comments