Completed
Last Updated: 19 Jun 2017 11:49 by ADMIN
Please refer to the attached gif file demonstrating how to reproduce the error with the Demo application.

Workaround: change the DropDownStyle property to DropDownList:

private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridDropDownListEditor editor = e.Editor as PropertyGridDropDownListEditor;
    if (editor!=null)
    {
        BaseDropDownListEditorElement editorElement = editor.EditorElement as BaseDropDownListEditorElement;
        editorElement.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
    }
}

Completed
Last Updated: 03 Jan 2017 14:54 by ADMIN
To reproduce:
public Form1()
{
    InitializeComponent();
    this.radPropertyGrid1.Size = new System.Drawing.Size(272, 135);
    PropertyStoreItem intItem = new PropertyStoreItem(typeof(int), "Integer", 1);
    PropertyStoreItem showTrend = new PropertyStoreItem(typeof(bool), "ShowTrend", 0);
    PropertyStoreItem trendItem1 = new PropertyStoreItem(typeof(int), "TrendTypes", 0);
    // Case of Re-loading the previously Saved Trend Type
    PropertyStoreItem floatItem = new PropertyStoreItem(typeof(float), "Float", 1f,
        "Property storing a floating point value.");
    PropertyStoreItem stringItem = new PropertyStoreItem(typeof(string), "String", "Telerik",
        "Property storing a string value", "Telerik");
    PropertyStoreItem dockItem = new PropertyStoreItem(typeof(DockStyle), "Dock", DockStyle.Top,
        "Property containing DockStyle value", "Layout", false);
    RadPropertyStore store = new RadPropertyStore();
    store.Add(intItem);
    store.Add(showTrend);
    store.Add(trendItem1);
    store.Add(floatItem);
    store.Add(stringItem);
    store.Add(dockItem);
    this.radPropertyGrid1.SelectedObject = store;
   radPropertyGrid1.Items["TrendTypes"].Visible = false;
    this.radPropertyGrid1.PropertyValueChanged += radPropertyGrid1_ValueChanged;

}

private void radPropertyGrid1_ValueChanged(object sender, PropertyGridItemValueChangedEventArgs e)
{

    PropertyGridItem current = (PropertyGridItem)e.Item;
    if (current.Name == "ShowTrend")
    {
        bool val = Convert.ToBoolean(current.Value);
        radPropertyGrid1.Items["TrendTypes"].Visible = val;
    }

}

- There is no scrollbar when the item is shown.

Workaround:
radPropertyGrid1.PropertyGridElement.PropertyTableElement.Update(PropertyGridTableElement.UpdateActions.ExpandedChanged);

Completed
Last Updated: 18 Oct 2016 09:26 by ADMIN
To reproduce: please refer to the attached gif file.

The error is not reproduced each time with the Demo application. Sometimes an unhandled exception dialog appears and sometimes the application becomes unresponsive and you can not close the application with upper right X, the options to the right does not respond, you can not change demo using the list on the left. Selecting "Settings" in Property Grid section and then clicking on a boolean property (left column), scrolling using the mouse wheel, then selecting another property (with PropertyGridDropDownListEditor) or clicking around in the application (even outside of the property grid form).

Workaround:   this.radPropertyGrid1.EditorRequired += radPropertyGrid1_EditorRequired;

private void radPropertyGrid1_EditorRequired(object sender, PropertyGridEditorRequiredEventArgs e)
{
    if (e.EditorType == typeof(PropertyGridDropDownListEditor))
    {
        e.Editor = new CustomPropertyGridDropDownListEditor();
    }
}

public class CustomPropertyGridDropDownListEditor : PropertyGridDropDownListEditor
{
    public override object Value
    {
        get
        {
            PropertyGridItemElement element = this.OwnerElement as PropertyGridItemElement;
            PropertyGridItem item = element.Data as PropertyGridItem;
            if (item == null)
            {
                return null;
            }
            return base.Value;
        }
        set
        {
            base.Value = value;
        }
    }
}
Completed
Last Updated: 03 Jul 2017 11:25 by ADMIN
To reproduce: subscribe to the RadPropertyGrid.PropertyValidating event and apply ErrorMessage in some cases. If the validation fails, the error indicator is not visible in Windows8, VisualStudio2012Dark, Aqua. However, the error message is displayed as expected.

Workaround: assign an image for the ErrorIndicator

private void radPropertyGrid1_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e)
{
    PropertyGridItemElement itemElement = e.VisualElement as PropertyGridItemElement;
    if (itemElement != null)
    {
        ((PropertyGridTextElement)itemElement.TextElement).ErrorIndicator.Image = Properties.Resources.error;
    }
}
Completed
Last Updated: 10 Feb 2016 15:41 by ADMIN
Completed
Last Updated: 05 Feb 2016 07:07 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: PropertyGrid
Type: Bug Report
1
To reproduce: use the following code snippet and refer to the attached gif file.

public Form1()
{
    InitializeComponent();
    this.radPropertyGrid1.SelectedObject = this;
    this.radPropertyGrid1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
}

Workaround:

public Form1()
{
    InitializeComponent();
    this.radPropertyGrid1.CreateItemElement += radPropertyGrid1_CreateItemElement;
    this.radPropertyGrid1.SelectedObject = this;
    this.radPropertyGrid1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
}

private void radPropertyGrid1_CreateItemElement(object sender, CreatePropertyGridItemElementEventArgs e)
{
    if (e.ItemElementType == typeof(PropertyGridItemElement))
    {
        e.ItemElementType = typeof(CustomPropertyGridItemElement);
    }
}

public class CustomPropertyGridItemElement : PropertyGridItemElement
{
    private bool isResizing;
    private Point downLocation;
    private int downWidth;

    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(PropertyGridItemElement);
        }
    }

    private const int resizePointerOffset = 3;

    public override bool IsInResizeLocation(Point location)
    {
        return (location.X >= this.ControlBoundingRectangle.X + this.PropertyTableElement.ValueColumnWidth - resizePointerOffset &&
                location.X <= this.ControlBoundingRectangle.X + this.PropertyTableElement.ValueColumnWidth + resizePointerOffset);
    }

    protected override void OnMouseDown(MouseEventArgs e)
    {
        if (IsInResizeLocation(e.Location))
        {
            if (this.PropertyTableElement.IsEditing)
            {
                this.PropertyTableElement.EndEdit();
            }

            this.Capture = true;
            this.isResizing = true;
            this.downLocation = e.Location;
            this.downWidth = this.PropertyTableElement.ValueColumnWidth;
        }

        base.OnMouseDown(e);
    }

    protected override void OnMouseMove(MouseEventArgs e)
    {
        if (this.isResizing)
        {
            int delta = e.Location.X - downLocation.X;

            if (this.RightToLeft)
            {
                delta *= -1;
            }

            this.PropertyTableElement.ValueColumnWidth = downWidth - delta;
            return;
        }

        if (this.IsInResizeLocation(e.Location))
        {
            this.ElementTree.Control.Cursor = Cursors.VSplit;
        }
        else
        {
            this.ElementTree.Control.Cursor = Cursors.Default;
        }

        base.OnMouseMove(e);
    }

    protected override void OnMouseUp(MouseEventArgs e)
    {
        if (this.isResizing)
        {
            this.isResizing = false;
            this.Capture = false;
        }

        base.OnMouseUp(e);
    }
}
Completed
Last Updated: 12 Jan 2016 06:42 by ADMIN
To reproduce: use the following code snippet and refer to the attached gif file:

 public Form1()
 {
     InitializeComponent(); 
     this.radPropertyGrid1.SelectedObject = this;
 }

 private void radButton1_Click(object sender, EventArgs e)
 {
     ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Dark";
 }

 private void radButton2_Click(object sender, EventArgs e)
 {
     ThemeResolutionService.ApplicationThemeName = "ControlDefault";
 }


Workaround:

private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridTextBoxEditor editor = e.Editor as PropertyGridTextBoxEditor;
    if (editor != null)
    {
        BaseTextBoxEditorElement el = editor.EditorElement as BaseTextBoxEditorElement;
        if (el != null)
        {
            el.BackColor = Color.Black;
        }
    }
}
Completed
Last Updated: 23 Feb 2016 08:21 by ADMIN
To reproduce:

PropertyStoreItem prop1 = new PropertyStoreItem(typeof(DateTime), "Date", DateTime.Now);
PropertyStoreItem prop2 = new PropertyStoreItem(typeof(Nullable<DateTime>), "NullableDate", DateTime.Now);
PropertyStoreItem prop3 = new PropertyStoreItem(typeof(DateTime?), "Date?", DateTime.Now);

RadPropertyStore store = new RadPropertyStore();
store.Add(prop1);
store.Add(prop2);
store.Add(prop3); 
this.radPropertyGrid1.SelectedObject = store;

Open the editor for one of the properties and press the Clear button in the PropertyGridDateTimeEditor's popup. The value is cleared, but the PropertyValueButtonElement is not displayed.

Workaround: specify the initial value as default value for the property:

public Form1()
{
    InitializeComponent();

    DateTime initialValue = DateTime.Now;
    PropertyStoreItem prop1 = new PropertyStoreItem(typeof(DateTime), "Date", initialValue);
    prop1.Attributes.Add(new DefaultValueAttribute(initialValue));
    PropertyStoreItem prop2 = new PropertyStoreItem(typeof(Nullable<DateTime>), "NullableDate", initialValue);
    prop2.Attributes.Add(new DefaultValueAttribute(initialValue));
    PropertyStoreItem prop3 = new PropertyStoreItem(typeof(DateTime?), "Date?", initialValue);
    prop3.Attributes.Add(new DefaultValueAttribute(initialValue));
    
    RadPropertyStore store = new RadPropertyStore();
    store.Add(prop1);
    store.Add(prop2);
    store.Add(prop3); 
    this.radPropertyGrid1.SelectedObject = store;
     
}
Completed
Last Updated: 05 Jun 2015 13:16 by ADMIN
Workaround: set the RadPropertyGrid.SelectedGridItem property to null before changing the SelectedObject.
Completed
Last Updated: 10 Mar 2015 10:57 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: PropertyGrid
Type: Bug Report
0
To reproduce: 

1. Add a RadPropertyGrid and populate it with all of of  items by using the following code:
                      this.radPropertyGrid1.SelectedObject = this;
2. Expand two items.
3. Scroll to the bottom.
4. Scroll to the top.
5. If you scroll to the bottom again, you will see a lot of empty space. The attached gif file illustrates better the problem.

Workaround:
public Form1()
{
    InitializeComponent();

    this.radPropertyGrid1.SelectedObject = this;
    this.radPropertyGrid1.PropertyGridElement.PropertyTableElement.Scroller.Traverser =
        new CustomPropertyGridTraverser(this.radPropertyGrid1.PropertyGridElement.PropertyTableElement);
}

public class CustomPropertyGridTraverser : PropertyGridTraverser
{
    public CustomPropertyGridTraverser(PropertyGridTableElement propertyGridElement) : base(propertyGridElement)
    {
    }

    public int Index
    {
        get
        {
            FieldInfo fi = typeof(PropertyGridTraverser).GetField("index", BindingFlags.NonPublic | BindingFlags.Instance);
            return int.Parse(fi.GetValue(this).ToString());
        }
        set 
        {
            FieldInfo fi = typeof(PropertyGridTraverser).GetField("index", BindingFlags.NonPublic | BindingFlags.Instance);
            fi.SetValue(this, value);
        }
    }

    public int GroupIndex
    {
        get
        {
            FieldInfo fi = typeof(PropertyGridTraverser).GetField("groupIndex", BindingFlags.NonPublic | BindingFlags.Instance);
            return int.Parse(fi.GetValue(this).ToString());
        }
    }

    public PropertyGridTableElement Element
    {
        get
        {
            FieldInfo fi = typeof(PropertyGridTraverser).GetField("propertyGridElement", BindingFlags.NonPublic | BindingFlags.Instance);
            return fi.GetValue(this) as PropertyGridTableElement ;
        }
    }

    public PropertyGridItemBase Item
    {
        get
        {
            FieldInfo fi = typeof(PropertyGridTraverser).GetField("item", BindingFlags.NonPublic | BindingFlags.Instance);
            return fi.GetValue(this) as PropertyGridItemBase ;
        }
        set 
        {
            FieldInfo fi = typeof(PropertyGridTraverser).GetField("item", BindingFlags.NonPublic | BindingFlags.Instance);
            fi.SetValue(this, value);
        }
    }

    protected override bool MovePreviousFromDataItem(PropertyGridItemBase currentItem)
    {
        if (currentItem.Parent != null && currentItem.Parent.GridItems.Count > 0)
        {
            if (this.Index > 0)
            {
                PropertyGridItemBase prevItem = currentItem.Parent.GridItems[--this.Index];
                if (prevItem.Expandable && (prevItem.Expanded || this.TraverseHirarchy))
                {
                    prevItem = this.GetLastChild(prevItem);
                }

                this.Item = prevItem;
                return true;
            }

            this.Item = currentItem.Parent;
            this.Index = -1;
            if (currentItem.Parent.Parent != null)
            {
                this.Index = currentItem.Parent.Parent.GridItems.IndexOf(currentItem.Parent as PropertyGridItem);
            }
            else
            {
                if (this.Element.CollectionView.Groups.Count == 0)
                {
                    this.Index = this.Element.CollectionView.IndexOf(currentItem.Parent as PropertyGridItem);
                }
                else
                {
                    this.Index = this.Element.CollectionView.Groups[this.GroupIndex].IndexOf(currentItem.Parent as PropertyGridItem);
                }
            }
            return true;
        }
        return base.MovePreviousFromDataItem(currentItem);
    }
}
Completed
Last Updated: 05 Jun 2015 13:26 by ADMIN
The PropertyChanged event does not fire when the ValueColumnWidth property is changed.
Completed
Last Updated: 20 Jan 2015 15:46 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: PropertyGrid
Type: Bug Report
0
To reproduce: 
private void PopulateGrid()
{
    this.radPropertyGrid1.SortOrder = System.Windows.Forms.SortOrder.Ascending;
    PropertyStoreItem myRadProp;
  
    RadPropertyStore myRadProperties = new RadPropertyStore();

    for (int i = 0; i <= 6000; i++)
    {

        myRadProp = new PropertyStoreItem(typeof(string), "PropName" + i, "Value" + i, "Help" + i, "same");

        myRadProperties.Add(myRadProp);
    }

    radPropertyGrid1.SelectedObject = myRadProperties;
}


Workaround:

public Form1()
{
    InitializeComponent();

    radPropertyGrid1.PropertyGridElement.PropertyTableElement.ListSource.CollectionView.GroupFactory =
        new MyPropertyGridGroupFactory(this.radPropertyGrid1.PropertyGridElement.PropertyTableElement);
    this.radPropertyGrid1.SortOrder = System.Windows.Forms.SortOrder.Ascending;
    PropertyStoreItem myRadProp;

    RadPropertyStore myRadProperties = new RadPropertyStore();

    for (int i = 0; i <= 6000; i++)
    {
        myRadProp = new PropertyStoreItem(typeof(string), "PropName" + i, "Value" + i, "Help" + i, "same");

        myRadProperties.Add(myRadProp);
    }
           
    this.radPropertyGrid1.PropertyGridElement.PropertyTableElement.ListSource.BeginUpdate();
    radPropertyGrid1.SelectedObject = myRadProperties;
    this.radPropertyGrid1.PropertyGridElement.PropertyTableElement.ListSource.EndUpdate();
}

public class MyPropertyGridGroupFactory : IGroupFactory<PropertyGridItem>
{
    private PropertyGridTableElement propertyGridElement;

    public MyPropertyGridGroupFactory(PropertyGridTableElement propertyGridElement)
    {
        this.propertyGridElement = propertyGridElement;
    }

    public GroupCollection<PropertyGridItem> CreateCollection(IList<Group<PropertyGridItem>> list)
    {
        return new PropertyGridGroupCollection(list);
    }

    public Group<PropertyGridItem> CreateGroup(object key, Group<PropertyGridItem> parent, params object[] metaData)
    {
        return new MyPropertyGridGroup(key, parent, this.propertyGridElement);
    }
}

public class MyPropertyGridGroup : PropertyGridGroup
{
    private List<PropertyGridItem> items;

    public MyPropertyGridGroup(object key, Group<PropertyGridItem> parent, 
        PropertyGridTableElement propertyGridElement) : base(key, parent, propertyGridElement)
    {
    }

    protected override IList<PropertyGridItem> Items
    {
        get
        {
            if (this.items == null)
            {
                this.items = new List<PropertyGridItem>();
            }

            return this.items;
        }
    }
}
Completed
Last Updated: 26 Jan 2015 16:02 by ADMIN
To reproduce:
 radPropertyGrid1.SelectedObject = new RadDropDownList();

The Items collection does not have a setter, but one still should be able to add items via the respective editor.
Completed
Last Updated: 07 Jan 2015 14:31 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radPropertyGrid1.SelectedObject = new Item(123, "SampleName");
}

public class Item
{
    public int Id { get; set; }
    public string Name { get; set; }

    public Item(int id, string name)
    {
        this.Id = id;
        this.Name = name;
    }
}

Activate the editor for the "Id" property and click the up arrow of the PropertyGridSpinEditor. Then click on the text box.

Workaround:

private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridSpinEditor spinEditor = e.Editor as PropertyGridSpinEditor ;
    if (spinEditor != null)
    {
        BaseSpinEditorElement spinEditorElement = spinEditor.EditorElement as BaseSpinEditorElement;
        var eventInfo = spinEditorElement.TextBoxItem.HostedControl.GetType().GetEvent("MouseEnter");
        var methodInfo = spinEditorElement.TextBoxItem.GetType().GetMethod("TextBoxControl_MouseEnter",
            System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
        Delegate handler = Delegate.CreateDelegate(typeof(EventHandler), spinEditorElement.TextBoxItem, methodInfo);
        eventInfo.RemoveEventHandler(spinEditorElement.TextBoxItem.HostedControl, handler);

        var eventInfo2 = spinEditorElement.TextBoxItem.HostedControl.GetType().GetEvent("MouseLeave");
        var methodInfo2 = spinEditorElement.TextBoxItem.GetType().GetMethod("textBoxItem_MouseLeave",
            System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
        Delegate handler2 = Delegate.CreateDelegate(typeof(EventHandler), spinEditorElement.TextBoxItem, methodInfo2);
        eventInfo2.RemoveEventHandler(spinEditorElement.TextBoxItem.HostedControl, handler2);
    }
}
Completed
Last Updated: 13 Nov 2014 12:15 by ADMIN
To reproduce: use the following code:

Items _items = new Items();

public Form1()
{
    InitializeComponent(); 

    radPropertyGrid1.SelectedObject = _items;
}

class Items
{
    [Description("A Bool Property")]
    public bool IsEnabled
    {
        get
        {
            return _isEnabled;
        }
        set
        {
            _isEnabled = value;
            RadMessageBox.Show("IsEnabled");
        }
    }
    private bool _isEnabled;

    [Description("A String Property")]
    public string Name
    {
        get { return _name; }
        set
        {
            _name = value;
            RadMessageBox.Show("Name");
        }
    }
    private string _name ;

}

Steps to perform:
1. Change the "Name" property and leave the editor active.
2. Click on the check box to change the "IsEnabled" property.

As a result you will notice that the "IsEnabled" setter is called before the "Name" setter.

Workaround:

Items _items = new Items();

public Form1()
{
    InitializeComponent(); 

    this.radPropertyGrid1.CreateItemElement += radPropertyGrid1_CreateItemElement;        
    radPropertyGrid1.SelectedObject = _items;
}

private void radPropertyGrid1_CreateItemElement(object sender, CreatePropertyGridItemElementEventArgs e)
{
    if (e.ItemElementType == typeof(PropertyGridCheckBoxItemElement))
    {
        e.ItemElementType = typeof(CustomPropertyGridCheckBoxItemElement);
    }
}

public class CustomPropertyGridCheckBoxItemElement : PropertyGridCheckBoxItemElement
{
    public CustomPropertyGridCheckBoxItemElement()
    {
        this.CheckBoxElement.ToggleStateChanging += CheckBoxElement_ToggleStateChanging;
    }

    private void CheckBoxElement_ToggleStateChanging(object sender, StateChangingEventArgs args)
    {
        if (this.PropertyTableElement.ActiveEditor != null && this.PropertyTableElement.SelectedGridItem != this.Data)
        {
            this.PropertyTableElement.EndEdit();
        }
    }

    protected override void DisposeManagedResources()
    {
        this.CheckBoxElement.ToggleStateChanging -= CheckBoxElement_ToggleStateChanging;

        base.DisposeManagedResources();
    }
}
Completed
Last Updated: 25 Dec 2014 14:46 by ADMIN
To reproduce:
- Add a property grid to a blank form set the selected object the the same form.
- Group the items and click several times to expand collapse the groups or items.
- you will notice that some of expanded/collapsed groups icon is in wrong state (same applies for the +/- sign of the properties).
Completed
Last Updated: 28 Oct 2014 16:06 by Moe
To reproduce:
- Add 20 document windows that contain property grid to a dock (use RadTextBox for he grid's selected object).
- Close and dispose the windows.
- The memory is not properly released.
Completed
Last Updated: 31 Jul 2014 08:55 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: PropertyGrid
Type: Bug Report
0
To reproduce:
1. Add a RadPropertyGrid and a RadButton.
2. Create custom PropertyGridItemElement with custom PropertyGridValueElement in order to display permanently RadDropDownListElement
3. Use the following code snippet:

public Form1()
{
    InitializeComponent();

    this.radPropertyGrid1.CreateItemElement += radPropertyGrid1_CreateItemElement;
    this.radPropertyGrid1.Editing += radPropertyGrid1_Editing;
}

private void radPropertyGrid1_Editing(object sender,
    PropertyGridItemEditingEventArgs e)
{
    if (e.Item.Name == "Direction")
    {
        e.Cancel = true;
    }
}

private void radPropertyGrid1_CreateItemElement(object sender,
    CreatePropertyGridItemElementEventArgs e)
{
    PropertyGridItem item = (PropertyGridItem)e.Item;
    if (e.Item.Name == "Direction")
    {
        e.ItemElementType = typeof(CustomItemElement);
    }
}

public class CustomItemElement : PropertyGridItemElement
{
    protected override PropertyGridValueElement CreatePropertyGridValueElement()
    {
        return new CustomPropertyGridValueElement();
    }

    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(PropertyGridItemElement);
        }
    }
}

public class CustomPropertyGridValueElement : PropertyGridValueElement
{
    RadDropDownListElement dropdown;

    protected override void CreateChildElements()
    {
        base.CreateChildElements();
 
        dropdown = new RadDropDownListElement();
        dropdown.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
        this.Children.Add(dropdown);

        dropdown.DataSource = Enum.GetValues(typeof(Direction));
        dropdown.SelectedIndexChanged += dropdown_SelectedIndexChanged;
    }

    private void dropdown_SelectedIndexChanged(object sender,
        Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
    {
        RadDropDownListElement ddle = sender as RadDropDownListElement;
        if (ddle != null && e.Position > -1)
        {
            PropertyGridItem item = this.VisualItem.Data as PropertyGridItem;
            if (item != null)
            {
                item.Value = ddle.Items[e.Position].DataBoundItem;
            }
        }
    }

    public override void Synchronize()
    {
        PropertyGridItem item = this.VisualItem.Data as PropertyGridItem;
        dropdown.SelectedValue = item.Value;
    }
}

public class Item
{
    public int Id { get; set; }

    public Direction Direction { get; set; }

    public string Title { get; set; }

    public Item(int id, string title, Direction direction)
    {
        this.Id = id;
        this.Title = title;
        this.Direction = direction;
    }
}

public enum Direction
{
    Up,
    Down,
    Left,
    Right
}

private void radButton1_Click(object sender, EventArgs e)
{
    this.radPropertyGrid1.SelectedObject = new Item(123, "Title", Direction.Left);
}

When you click the button once, the RadPropertyGrid displays the desired data. However, if you click the button once again, ArgumentOutOfRangeException occurs.

Workaround:wrap setting the SelectedObject in a SuspendLayout/ResumeLayout block:

this.radPropertyGrid1.SuspendLayout();
this.radPropertyGrid1.SelectedObject = new Item(123, "Title", Direction.Left);
this.radPropertyGrid1.ResumeLayout();
Completed
Last Updated: 01 Oct 2014 13:01 by ADMIN
To reproduce:

Set the following object as selected of RadPropertyGrid: 

class TestClass : System.ComponentModel.INotifyPropertyChanged
{
    private string loggingType = "0";

    [TypeConverter(typeof(CustomListConverter)), CategoryAttribute("Logging Settings")]
    public string LoggingType
    {
        get { return loggingType; }
        set
        {
            loggingType = value;
            OnPropertyChanged("LoggingType");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    public virtual void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }

}

And use the following converter:

public class CustomListConverter : System.ComponentModel.StringConverter
{
    ArrayList _AllStringValues = new ArrayList();
    Hashtable _Map = new Hashtable();

    public CustomListConverter()
    {
    }

    public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext conte
    {
        FillValuesFromContext();
        StandardValuesCollection standardValues = new StandardValuesCollection(_AllStringValues);
        return standardValues;
    }

    private void FillValuesFromContext()
    {
        if (_AllStringValues.Count > 0)
            return;

        _AllStringValues.Clear();
        _Map.Clear();

        string str = "-5,Fatal|-4,Error|-3,Warning|-2, Info|-1,Debug|0,Trace";

        string[] strMapVals = str.Split('|');
        for (int i = 0; i < strMapVals.Length; i++)
        {
            string[] strVals = strMapVals[i].Split(',');
            if (strVals.Length != 2)
                continue;

            _AllStringValues.Add(strVals[0].Trim());
            _Map.Add(strVals[0].Trim(), strVals[1].Trim());
        }
    }

    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
    {
        FillValuesFromContext();

        string displayString = "";

        IEnumerator enumTable = _Map.Keys.GetEnumerator();

        while (enumTable.MoveNext())
        {
            if (_Map[enumTable.Current] as string == value as string)
            {
                displayString = enumTable.Current as string;
                break;
            }
        }

        return displayString;
    }

    public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
    {
        FillValuesFromContext();

        if (null != value && _Map.ContainsKey(value.ToString()))
        {
            return _Map[value];
        }

        return value;
    }

    public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
    {
        return true;
    }

    public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
    {
        return true;
    }
}

When you start the application you will see that the value of the property is set to -1, while it should be converted to 'Debug'

Workaround:

Create a custom PropertyGridItem:

public class MyPropertyGridItem : PropertyGridItem
{
    public MyPropertyGridItem(PropertyGridTableElement element)
        : base(element)
    {
    }

    public override string FormattedValue
    {
        get
        {
            string baseFormattedValue =  base.FormattedValue;
            TypeConverter converter = TypeConverter;

            if (converter != null && converter.CanConvertTo(this, typeof(string)))
            {
                baseFormattedValue = converter.ConvertToString(this, System.Threading.Thread.CurrentThread.CurrentCulture, this.Value);
            }

            return baseFormattedValue;
        }
        set
        {
            base.FormattedValue = value;
        }
    }
}

Use it by subscribing to the CreateItem event:

void radPropertyGrid1_CreateItem(object sender, Telerik.WinControls.UI.CreatePropertyGridItemEventArgs e)
{
    e.Item = new MyPropertyGridItem(this.radPropertyGrid1.PropertyGridElement.PropertyTableElement);
}

Completed
Last Updated: 30 May 2014 08:27 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: PropertyGrid
Type: Bug Report
1
To reproduce: use a class with more than 100 properties for the RadPropertyGrid.SelectedObject. On RadButton.Click event set the RradPropertyGrid.PropertySort to PropertySort.CategorizedAlphabetical.