AllowDefaultContextMenu not respected on property change?

3 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 18 Feb 2013 Link to this post

    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. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 21 Feb 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 21 Feb 2013 Link to this post

    Thanks. That will do!
Back to Top