This is a migrated thread and some comments may be shown as answers.

AllowDefaultContextMenu not respected on property change?

2 Answers 63 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 18 Feb 2013, 10:30 AM
http://www.telerik.com/help/winforms/p_telerik_wincontrols_ui_radpropertygrid_allowdefaultcontextmenu.html

myPropertyGrid.AllowDefaultContextMenu = false;

If I change a value I can still see this little "show more" arrow as shown in the attached image. Clicking it does not show the menu, but why draw it in the first place?

2 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 21 Feb 2013, 07:57 AM
Hello Kristoffer,

Thank you for writing.

The little element that appears is an indication that a property has been modified. If you want to hide it you can use the ItemFormatting event. Here is an example:
private void radPropertyGrid1_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e)
{
    PropertyGridItemElement element = e.VisualElement as PropertyGridItemElement;
 
    if (element != null)
    {
        PropertyValueButtonElement buttonElement = element.TextElement.FindDescendant<PropertyValueButtonElement>();
 
        if (buttonElement != null)
        {
            buttonElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
        }
    }
}
I hope this will be useful for you. Feel free to write back with any further questions.

Kind regards,
Ivan Petrov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Kristoffer
Top achievements
Rank 1
answered on 21 Feb 2013, 08:47 AM
Thanks. That will do!
Tags
PropertyGrid
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Kristoffer
Top achievements
Rank 1
Share this question
or