User alternative ExpandImage an BackColors

2 posts, 1 answers
  1. Gøran
    Gøran avatar
    3 posts
    Member since:
    Jun 2011

    Posted 13 May 2014 Link to this post

    Hi Telerik Team,

    I tried to switch the expandImage of the radPropertyGrid for several hours now. Hopefully you can help me to switch the Image ( see attachment -> red box ). In addition to this... how do I switch the backcolor of the sourrounding bars ( see attachment -> yellow boxes ).

    I'm setting the content of the radPropertyGrid during runtime using the SelectedObject Property.

    Thank you in advance :)
  2. Answer
    Dess avatar
    1562 posts

    Posted 16 May 2014 Link to this post

    Hello Gøran,

    Thank you for writing.

    It is appropriate to use the ItemFormatting event in order to customize the described elements:
    public Form1()
        this.radPropertyGrid1.SelectedObject = this;
        this.radPropertyGrid1.ToolbarVisible = true;
    private void radPropertyGrid1_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e)
        PropertyGridGroupElement groupElement = e.VisualElement as PropertyGridGroupElement;
        PropertyGridItemElement itemElement = e.VisualElement as PropertyGridItemElement;
        if (groupElement!=null)
            groupElement.ExpanderElement.ExpanderItem.Image = Properties.Resources.arrow;
            groupElement.ExpanderElement.ExpanderItem.ImageLayout = ImageLayout.Zoom;
            groupElement.TextElement.BackColor = Color.Red;
            groupElement.TextElement.DrawFill = true;
            groupElement.TextElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
        else if (itemElement!=null)
            itemElement.ExpanderElement.BackColor = Color.LightBlue;

    I hope this information helps. Should you have further questions, I would be glad to help.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft R3 2016 release webinar banner
Back to Top