how to add icons

2 posts, 0 answers
  1. Prashant
    Prashant avatar
    3 posts
    Member since:
    Jan 2013

    Posted 21 Mar 2014 Link to this post

    How can I add icons to Category panel in property grid.

    Also, how to add icon to propertyentry element in Grid.  

    [-]  [icon]   Appearance (category tab)
           [some icon_1]  Color             |   Red
           [some icon_2]  Orientation   |   Left
                                      Preview       |    [ Preview image]

  2. Dess
    Dess avatar
    1561 posts

    Posted 25 Mar 2014 Link to this post

    Hello Prashant,

    Thank you for contacting Telerik Support.

    It is appropriate to use the ItemFormatting event and set the desired image for the specific PropertyGridItemElement:
    public Form1()
        radPropertyGrid1.PropertySort = PropertySort.Categorized;
        radPropertyGrid1.SelectedObject = new Item(1234, "Custom title", "Description", 9834657);
        radPropertyGrid1.ItemFormatting += radPropertyGrid1_ItemFormatting;
        radPropertyGrid1.PropertyGridElement.PropertyTableElement.ItemHeight = 50;
    private void radPropertyGrid1_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e)
        PropertyGridItemElement item = e.VisualElement as PropertyGridItemElement;
        if (item != null && e.Item.Name=="Photo" )
            item.ValueElement.DrawText = false;
            item.ValueElement.Image = Properties.Resources.AndrewFuller;
            item.ValueElement.ImageLayout = ImageLayout.Zoom;
    public class Item
        public int Id { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public int BarCode { get; set; }
        public Image Photo { get; set; }
        public Item(int id, string title, string description, int barCode)
            this.Id = id;
            this.Title = title;
            this.Description = description;
            this.BarCode = barCode;

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

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

  3. DevCraft R3 2016 release webinar banner
Back to Top