Completed
Last Updated: 31 May 2014 07:01 by ADMIN
When a property has a TypeConverter and a UITypeEditor attributes the PropertyGridUITypeEditor calls the TypeConverter methods with the context parameter equal to null.
Completed
Last Updated: 31 May 2014 07:05 by ADMIN
When the SelectedObject contains sub-properties and a user expands a property the CreateItem event is not fired for sub items.
Completed
Last Updated: 01 Oct 2014 13:01 by ADMIN
If one sets an empty RadPropertyStore to the SelectedObject property of a RadPropertyGrid and then adds items with a RadSortOrder attribute the items will still be sorted by their name.



WORKAROUNDS:

1. Populate the store before you set it to the property grid.

2. Add a dummy item to the store before you set it to the property grid and then remove it:
RadPropertyStore store = new RadPropertyStore();
store.Add(typeof(bool), "dummy", false);
this.radPropertyGrid1.SelectedObject = store;
store.RemoveAt(0);

3. After you add the first item to the store call the following method:
this.radPropertyGrid1.PropertyGridElement.PropertyTableElement.ListSource.CollectionView.EnsureDescriptors();
Completed
Last Updated: 23 Apr 2014 06:27 by ADMIN
To reproduce:
1. Add a RadPropertyGrid and use the following code:


public partial class NewTestWindow : Form
{
    public NewTestWindow()
    {
        InitializeComponent();


        PropertyGridData data = new PropertyGridData();
        (data as INotifyPropertyChanged).PropertyChanged += NewTestWindow_PropertyChanged;


        ppgItems.SelectedObject = data;


        Type type = ppgItems.SelectedObject.GetType();
        MemberInfo[] members = type.GetMembers();
        foreach (MemberInfo m in members)
        {
            Attribute[] attributes = Attribute.GetCustomAttributes(m);
            foreach (Attribute attr in attributes)
            {
                if (attr is BrowsableCondition)
                {
                    BrowsableCondition condition = attr as BrowsableCondition;
                    PropertyGridItem gridItem = ppgItems.Items[m.Name];


                    gridItem.Visible = false;
                }
            }
        }
    }


    private void NewTestWindow_PropertyChanged(object sender, PropertyChangedEventArgs e)
    {
        if (ppgItems.SelectedObject != null)
        {
            PropertyInfo enableProperty = ppgItems.SelectedObject.GetType().GetProperty(e.PropertyName);
            bool? value = enableProperty.GetValue(ppgItems.SelectedObject, null) as bool?;


            if (value.HasValue)
            {
                Type type = ppgItems.SelectedObject.GetType();
                MemberInfo[] members = type.GetMembers();
                foreach (MemberInfo m in members)
                {
                    Attribute[] attributes = Attribute.GetCustomAttributes(m);
                    foreach (Attribute attr in attributes)
                    {
                        if (attr is BrowsableCondition)
                        {
                            BrowsableCondition condition = attr as BrowsableCondition;
                            PropertyGridItem gridItem = ppgItems.Items[m.Name];


                            gridItem.Visible = value.Value;
                        }
                    }
                }
            }
        }


        ppgItems.PropertyGridElement.PropertyTableElement.Update(PropertyGridTableElement.UpdateActions.Resume);
    }
}


public class PropertyGridData : INotifyPropertyChanged
{
    public string Item { get; set; }


    [Browsable(true)]
    [BrowsableCondition("Enable")]
    public bool A0 { get; set; }


    [Browsable(true)]
    [BrowsableCondition("Enable")]
    public bool A1 { get; set; }


    [Browsable(true)]
    [BrowsableCondition("Enable")]
    public bool A2 { get; set; }


    [Browsable(true)]
    [BrowsableCondition("Enable")]
    public bool A3 { get; set; }


    [Browsable(true)]
    [BrowsableCondition("Enable")]
    public bool A4 { get; set; }


    [Browsable(true)]
    [BrowsableCondition("Enable")]
    public bool A5 { get; set; }


    public string Anything { get; set; }


    private bool _enable;


    public bool Enable
    {
        get
        {
            return _enable;
        }


        set
        {
            _enable = value;
            RaisePropertyChanged("Enable");
        }
    }


    public event PropertyChangedEventHandler PropertyChanged;


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


public class BrowsableCondition : Attribute
{
    public BrowsableCondition(string propertyName)
    {
        this.PropertyName = propertyName;
    }


    public string PropertyName { get; set; }
}


2. Run the application. The RadPropertyGrid has a checkbox with Enable property.
When selected, other properties are displayed (A0, A1, A2, A3, A4, A5). When the user marks some of these checkboxes that were hidden and then uncheck the Enable property, the PropertyGridItemElement component throws a System.NullReferenceException. 
Completed
Last Updated: 23 Feb 2021 10:36 by ADMIN
Release R1 2021 SP2
Workaround:
 Private Sub RadPropertyGrid1_EditorRequired(sender As Object, e As PropertyGridEditorRequiredEventArgs) Handles RadPropertyGrid1.EditorRequired
     Dim te As PropertyGridTableElement = TryCast(sender, PropertyGridTableElement)
     If e.EditorType = GetType(PropertyGridSpinEditor) Then
         Dim editor As New CustomPropertyGridSpinEditor
         If editor IsNot Nothing AndAlso te IsNot Nothing Then
             Dim type As Type = RadPropertyGrid1.SelectedObject.[GetType]().GetProperty(e.Item.Name).PropertyType
             If type = GetType(System.Double) Then
                 DirectCast(editor.EditorElement, BaseSpinEditorElement).DecimalPlaces = 4
                 e.Editor = editor
             End If
         End If
     End If
 End Sub

 Public Class CustomPropertyGridSpinEditor
     Inherits PropertyGridSpinEditor
     Public Overrides Sub Initialize(owner As Object, value As Object)
         Dim decimalPlaces As Integer = Me.DecimalPlaces
         MyBase.Initialize(owner, value)

         Dim element As PropertyGridItemElement = TryCast(owner, PropertyGridItemElement)
         Dim item As PropertyGridItem = TryCast(element.Data, PropertyGridItem)
         Dim editedType As Type = item.PropertyType

        If ((editedType = GetType(Decimal) OrElse editedType = GetType(Double) OrElse editedType = GetType(Single)) AndAlso decimalPlaces <> 0) Then
         DirectCast(Me.EditorElement, BaseSpinEditorElement).DecimalPlaces = decimalPlaces
         Me.Value = value
       End If
     End Sub
 End Class
Completed
Last Updated: 28 Jun 2016 12:28 by ADMIN
To reproduce:

Add a RadPropertyGrid to a form.  Use the following code:

this.radPropertyGrid1.SortOrder = System.Windows.Forms.SortOrder.Ascending;
this.radPropertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Categorized;

As a workaround you can manually scroll to the top before performing a filtering operation:

public class MyPropertyGrid : RadPropertyGrid
{
    protected override PropertyGridElement CreatePropertyGridElement()
    {
        return new MyPropertyGridElement();
    }
}
 
public class MyPropertyGridElement : PropertyGridElement
{
    protected override PropertyGridToolbarElement CreateToolbarElement()
    {
        return new MyPropertyGridToolbarElement();
    }
 
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(PropertyGridElement);
        }
    }
}
 
public class MyPropertyGridToolbarElement : PropertyGridToolbarElement
{
    protected override void ExecuteSearch()
    {
        this.PropertyGridElement.PropertyTableElement.Scroller.Scrollbar.Value = 0;
        base.ExecuteSearch();
    }
}
Completed
Last Updated: 28 Jun 2016 11:45 by ADMIN
Add a RadPropertyGrid and change its Dock property to Fill. Use the following code:

public partial class Form1 : Form
{
    RadPropertyStore _store;

    public Form1()
    {
        InitializeComponent();
        this.radPropertyGrid1.CreateItemElement += new CreatePropertyGridItemElementEventHandler(this.onCreateItemElement);
        _store = new RadPropertyStore();

        PropertyStoreItem barItem = new PropertyStoreItem(typeof(Int32), "TrackBar", 25);
        _store.Add(barItem);

        PropertyStoreItem sec = new PropertyStoreItem(typeof(bool), "Checkr", true);
        _store.Add(sec);

        this.radPropertyGrid1.SelectedObject = _store;
    }

    private void onCreateItemElement(object sender, CreatePropertyGridItemElementEventArgs e)
    {
        PropertyGridItem item = e.Item as PropertyGridItem;

        if (item != null)
        {
            if (item.Name == "TrackBar")
            {
                e.ItemElementType = typeof(TrackBarPropertyGridItem);
            }
        }
    }
}

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

public class CustomPropertyGridValueElement : PropertyGridValueElement
{
    RadTrackBarElement _trackbar;

    public RadTrackBarElement Trackbar
    {
        get
        {
            return this._trackbar;
        }
    }

    protected override void CreateChildElements()
    {
        base.CreateChildElements();

        _trackbar = new RadTrackBarElement();
        _trackbar.Minimum = 0;
        _trackbar.Maximum = 100;
       
        this.DrawText = false;
        this.Children.Add(_trackbar);
    }
}



When resizing the form, the applications hangs.

Workaround:

/// <summary>
    /// Track bar property grid element
    /// </summary>
    public class TrackBarPropertyGridItem : PropertyGridItemElement
    {
        class MyTrackBarElement : RadTrackBarElement
        {
            protected override void OnNotifyPropertyChanged(string propertyName)
            {
                if (propertyName == "TickOffSet" || propertyName == "ThumbSize")
                {
                    this.BodyElement.ScaleContainerElement.InvalidateMeasure();
                    this.BodyElement.IndicatorContainerElement.InvalidateMeasure();
                    return;
                }

                base.OnNotifyPropertyChanged(propertyName);
            }

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

        /// <summary>
        /// The trackbar element to be displayed in the cell
        /// </summary>
        private RadTrackBarElement _trackbar;

        /// <summary>
        /// Accessor to the track bar element
        /// </summary>
        public RadTrackBarElement Trackbar
        {
            get { return _trackbar; }
        }

        /// <summary>
        /// Create child elements of the propertyGridItem
        /// </summary>
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            _trackbar = new MyTrackBarElement();
            _trackbar.Minimum = 0;
            _trackbar.Maximum = 100;
            _trackbar.ShowTicks = false;


            this.ValueElement.DrawText = false;
            this.ValueElement.Children.Add(this._trackbar);
        }

        /// <summary>
        /// Synchronise the value with property grid item
        /// </summary>
        public override void Synchronize()
        {
            base.Synchronize();

            PropertyGridItem item = this.Data as PropertyGridItem;

            this._trackbar.Value = (int)item.Value;
        }


        /// <summary>
        /// Add editor override
        /// </summary>
        /// <param name="editor">input editor</param>
        public override void AddEditor(IInputEditor editor)
        { }

        /// <summary>
        /// Remove editor override
        /// </summary>
        /// <param name="editor">input editor</param>
        public override void RemoveEditor(IInputEditor editor)
        { }

        /// <summary>
        /// Check if the item is comptable with trackbar editor
        /// </summary>
        /// <param name="data">item to check</param>
        /// <param name="context">context</param>
        /// <returns>true if compatible, false otherwise</returns>
        public override bool IsCompatible(PropertyGridItemBase data, object context)
        {
            PropertyGridItem item = data as PropertyGridItem;
            return (item != null && item.PropertyType == typeof(int));
        }

        /// <summary>
        /// Get the type of the property grid element
        /// </summary>
        protected override Type ThemeEffectiveType
        {
            get { return typeof(PropertyGridItemElement); }
        }
Completed
Last Updated: 15 Feb 2014 11:03 by ADMIN
ADMIN
Created by: George
Comments: 1
Category: PropertyGrid
Type: Bug Report
2
To reproduce:

Follow this article http://www.telerik.com/help/winforms/propertygrid-features-custom-grouping.html . You will notice that the CustomGrouping event will not fire.
Completed
Last Updated: 11 Feb 2014 16:30 by ADMIN
To reproduce:
- Create a property store and add some items to it.
- Start the project and click an item.

Workaround: - 
Add RadSortOrderAttribute to each item:

for (int i = 0; i < propStore.Count; i++)
                {
                    PropertyStoreItem item = propStore[i];
                    item.Attributes.Add(new RadSortOrderAttribute(i));
                }
Completed
Last Updated: 15 Nov 2013 06:16 by ADMIN
Steps to reproduce:

1. Create a class A with a boolean property
2. Create a class B with a property of type A and decorate it with [ReadOnly(true)] attribute
3. Set an instance of class B as the SelectedObject of a RadPropertyGrid
4. Try to change the boolean property. You will see you cannot.
Completed
Last Updated: 12 Nov 2013 17:44 by ADMIN
When the TypeConverter of a property cannot convert from string the text box editor that opens for this property should be read only.
Completed
Last Updated: 11 Nov 2013 05:17 by ADMIN
If the number of sub items for a property depends on the value of the properties and this value is changed the sub items are not invalidated in all cases.
Completed
Last Updated: 31 Mar 2014 10:18 by ADMIN
RadPropertyGrid - when default value attribute is Color.Empty, the items is styled with bold font and "Modified" icon. 

Workaround: Use ItemFormatting event to style the item correctly. Code to reproduce: public class TestObj { private Color someColor; public TestObj() { this.someColor = Color.Empty; } [DefaultValue(typeof(Color), "Empty")] public Color SomeColor { get { return someColor; } set { someColor = value; } } } TestObj newObj = new TestObj(); this.radPropertyGrid1.SelectedObject = newObj; 
Completed
Last Updated: 25 Oct 2013 06:11 by ADMIN
To reproduce:
- Click on a property (with a dropdown editor for example) to start edit.
- Move mouse over vertical center dividing line to get mouse to transition to resize pointer.
- Move mouse to the right back over the combo box that has been activated for edit.
- The mouse pointer will not transition back to the arrow, it will stay on the resize pointer.
Completed
Last Updated: 31 Mar 2014 10:21 by ADMIN
To reproduce: -add a RadPropertyGrid and use the following code: radPropertyGrid.SelectedObject = new MyPropertyGridAdapter(node); PropertyValueChanging += new PropertyGridItemValueChangingEventHandler(OnPropertyValueChanging); private void OnPropertyValueChanging(object sender, PropertyGridItemValueChangingEventArgs e) { var form = new CommentActionForm(); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var item = e.Item as PropertyGridItem; var pd = item.PropertyDescriptor as MyPropertyDescriptor; if (pd != null) { // Perform value change (affects database). } } else { e.Cancel = true; } } Workaround:when ending edit mode with Enter key you may use the following approach: public Form1() { InitializeComponent(); this.radPropertyGrid1.SelectedObject = new MyObject(10204, "Sample name", "Some descripion"); this.radPropertyGrid1.EditorRequired += radPropertyGrid1_EditorRequired; } private void radPropertyGrid1_EditorRequired(object sender, PropertyGridEditorRequiredEventArgs e) { PropertyGridItem propertyItem = e.Item as PropertyGridItem; e.Editor = new MyEditor(propertyItem); } public class MyObject { public int ID { get; set; } public string Name { get; set; } public string Description { get; set; } public MyObject(int iD, string name, string description) { this.ID = iD; this.Name = name; this.Description = description; } } public class MyEditor : PropertyGridTextBoxEditor { public string InitialValue { get; set; } public PropertyGridItem PropertyItem { get; set; } public MyEditor(PropertyGridItem item) : base() { this.PropertyItem = item; } public override void BeginEdit() { InitialValue = this.TextBoxEditorElement.Text; base.BeginEdit(); } } public class MyPropertyGrid : RadPropertyGrid { protected override bool ProcessDialogKey(Keys keyData) { if (this.ActiveEditor != null && this.ActiveEditor is MyEditor && keyData == Keys.Enter) { MyEditor editor = ((MyEditor)this.ActiveEditor); PropertyGridItem property = editor.PropertyItem; string initialValue = editor.InitialValue; DialogResult ds = RadMessageBox.Show("Are you sure?", "Title", MessageBoxButtons.OKCancel, RadMessageIcon.Question); if (ds == System.Windows.Forms.DialogResult.Cancel) { property.Value = initialValue; return false; } } return base.ProcessDialogKey(keyData); } }
Completed
Last Updated: 10 Oct 2013 07:45 by ADMIN
ADMIN
Created by: Georgi I. Georgiev
Comments: 0
Category: PropertyGrid
Type: Bug Report
0
To reproduce, use the following class:
public class NullableDummy
{
    public bool? Bool { get; set; }
    public byte? Byte { get; set; }
    public char? Char { get; set; }
    public decimal? Decimal { get; set; }
    public float? Float { get; set; }
    public int? Int { get; set; }
    public long? Long { get; set; }
    public sbyte? Sbyte { get; set; }
    public short? Short { get; set; }
    public string String { get; set; }
    public ulong? Ulong { get; set; }
    public ushort? Ushort{ get; set; }
}

And set it as a selected object of the property grid:
NullableDummy dummy = new NullableDummy();
this.propertyGrid.SelectedObject = dummy;

Change the Byte Property you will see that the value is not being set.
Completed
Last Updated: 20 Sep 2013 06:49 by ADMIN
Steps to reproduce: 
1. Add a RadPropertyGrid to a form 
2. Set the SelectedObject property to an object with numeric property 
3. Open the numeric property for edit and click the arrow buttons to change the value.
4. Click on another control that can take focus e.g. the form control box buttons You will see that the editor remains open.
Completed
Last Updated: 25 Jul 2013 08:24 by ADMIN
ADMIN
Created by: Georgi I. Georgiev
Comments: 0
Category: PropertyGrid
Type: Bug Report
0
To reproduce
 - create a form with a RadPropertyGrid.
 - set ToolbarVisible to true
 - add some properties, but not enough to cause the scrollbar to appear.
 - start and click on the sort button: the sort is changed, but the scroll bar became visible even if it is not needed.
Workaround:
public class MyPropGrid : RadPropertyGrid
{
    protected override PropertyGridElement CreatePropertyGridElement()
    {
        return new MyPropGridElement();
    }

    public override string ThemeClassName
    {
        get { return typeof(RadPropertyGrid).FullName; }
        set { }
    }
}

public class MyPropGridElement : PropertyGridElement
{
    protected override PropertyGridSplitElement CreateSplitElement()
    {
        return new MyPropGridSplitElement();
    }

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

public class MyPropGridSplitElement : PropertyGridSplitElement
{ 
    protected override PropertyGridTableElement CreateTableElement()
    {
        return new MyPropGridTableElemnet();
    }

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

public class MyPropGridTableElemnet : PropertyGridTableElement
{
    protected override void UpdateScrollers(UpdateActions updateAction)
    {
        this.Scroller.UpdateScrollRange();
    }

    protected override Type ThemeEffectiveType
    {
        get { return typeof(PropertyGridTableElement); }
    }
}
Completed
Last Updated: 19 Jul 2013 05:36 by ADMIN
To reproduce:
- Create a PropertyGrid and initialize it like this:
PropertyStoreItem checkboxItem = new PropertyStoreItem(typeof(bool), "Checkbox", true);
_store = new RadPropertyStore();
_store.Add(checkboxItem);
this.radPropertyGrid1.SelectedObject = _store;

-change the store item first to null then to false

Workaround:
-Before you set the item value to false set it to true first like this:
item.Value = null;

//set first to true then to false
item.Value = true;
item.Value = false;
Completed
Last Updated: 05 Jul 2013 01:44 by ADMIN
To reproduce:
List<PropertyStoreItem> propertyStoreItems = new List<PropertyStoreItem>();
propertyStoreItems.Add(modelItem);
RadPropertyStore store = new RadPropertyStore();
store.AddRange(propertyStoreItems);
Workaround:
Iterate the collection and use the Add method
foreach (var item in propertyStoreItems)
{
    store.Add(item);
}