Unplanned
Last Updated: 11 Apr 2024 11:41 by ADMIN

AlphabeticalToggleButton is not drawn correctly on 150% DPI. This is observed in the VisualStudio2022Light theme. In Fluent theme, the button is drawn correctly.

Unplanned
Last Updated: 16 Feb 2024 12:30 by Martin

I know that there is a RadRange Attribute but using it creates a dependency on Telerik.

Consider the scenario that the object to be configured via RadPropertyGrid is defined in a library that is used by multiple projects.

Unplanned
Last Updated: 16 Feb 2024 12:27 by ADMIN
Created by: n/a
Comments: 1
Category: PropertyGrid
Type: Feature Request
2

How to create a PropertyGrid and initialize it like this,modify the 'segments' arraies as I modify the 'count'

Unplanned
Last Updated: 25 Mar 2021 08:39 by ADMIN

Please run the sample project on a monitor with 150 DPI scaling. You will notice that the first time the drop down is not scaled properly and it is clipped. However, each next opening of the drop down, the popup is scaled correctly:

Unplanned
Last Updated: 24 Jan 2021 20:59 by Luca

The clients needs to use a PropertyGridDropDownListEditor and confirms the new value whenever a new selection is made. The attached gif file illustrates how to replicate the error using the following code snippet:

        public RadForm1()
        {
            InitializeComponent();

            this.radPropertyGrid1.SelectedObject = this; 
            this.radPropertyGrid1.EditorInitialized += radPropertyGrid1_EditorInitialized; 
        } 

        private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
        {
            PropertyGridDropDownListEditor ddl = e.Editor as PropertyGridDropDownListEditor;
            if (ddl != null)
            {
                ddl.LoopValuesOnDoubleClick = false;
                BaseDropDownListEditorElement element = ddl.EditorElement as BaseDropDownListEditorElement;

                if (element != null)
                { 
                    element.SelectedValueChanged -= Element_SelectedValueChanged;
                    element.SelectedValueChanged += Element_SelectedValueChanged;
                }
            }
        }
 
        private void Element_SelectedValueChanged(object sender, Telerik.WinControls.UI.Data.ValueChangedEventArgs e)
        {
            this.radPropertyGrid1.EndEdit();
        }

Workaround:

        public RadForm1()
        {
            InitializeComponent();

            this.radPropertyGrid1.SelectedObject = this;  

            this.radPropertyGrid1.ValueChanged += RadPropertyGrid1_ValueChanged;
        }

        private void RadPropertyGrid1_ValueChanged(object sender, EventArgs e)
        {
            if (this.radPropertyGrid1.ActiveEditor is PropertyGridDropDownListEditor)
            {
                this.radPropertyGrid1.EndEdit();
            }
        }

Unplanned
Last Updated: 16 Oct 2020 11:01 by ADMIN

Use the following code snippet and try to edit the Height. You will notice that the sub-items' order is changed:

            RadPropertyStore store = new RadPropertyStore();
            PropertyStoreItem sizeItem = new PropertyStoreItem(typeof(System.Drawing.Size), "Size", new System.Drawing.Size(100, 25), "The size of the control in pixels.", "Layout");
            store.Add(sizeItem);

            this.radPropertyGrid1.SelectedObject = store;
            this.radPropertyGrid1.SortOrder = SortOrder.Ascending;
            this.radPropertyGrid1.PropertySort = PropertySort.Alphabetical;

Unplanned
Last Updated: 16 Jul 2020 06:00 by ADMIN

Hello, 

we are trying to use RadPropertyGrid to show the properties of some objects listed in a RadGrdiView. 

We use ExpandableObject to expand our custom property, but we have some problems when we try to show the properties of multiple selected items, when the values of the attribute of the property are not the same in all the selected objects. We tried to use PropertyGrid of Winform and we don't have this problem. 

Thank you.

Unplanned
Last Updated: 23 Apr 2020 14:52 by ADMIN

Currently, the ExpandableObjectConverter is the appropriate solution for adding nested properties in RadPropertyGrid. Using TypeConverters is quite a flexible mechanism that RadPropertyGrid offers: https://docs.telerik.com/devtools/winforms/controls/propertygrid/type-converters

It would be nice to have a more flexible and easy approach, e.g. PropertyStoreItem .Items collection that allows you to add nested properties.

 
Unplanned
Last Updated: 25 May 2018 14:24 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: PropertyGrid
Type: Feature Request
1
This should work similar to RadGridView. Once should be able to manually set the height of on individual rows as well.
Unplanned
Last Updated: 21 May 2018 11:36 by ADMIN
The incorrect behavior is also observed if the SelectedObject is changed.

How to reproduce:

public partial class RadForm1 : RadForm
{
    public RadForm1()
    {
        this.InitializeComponent();
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        this.radPropertyGrid1.EnableSorting = true;
        this.radPropertyGrid1.SelectedObject = new TestObject();
        foreach (var item in this.radPropertyGrid1.Items)
        {
            if (item.Name == "A")
            {
                item.SortOrder = 2;
            }
            else if (item.Name == "B")
            {
                item.SortOrder = 1;
            }
            else
            {
                item.SortOrder = 0;
            }
        }

        this.radPropertyGrid1.PropertySort = PropertySort.NoSort;
    }
}

public class TestObject
{
    public int A { get; set; }
    public int C { get; set; }
    public int B { get; set; }
}

Workaround:
1. Use attributes in the model class:
public class TestObject
{
    [RadSortOrder(2)]
    public int A { get; set; }
    [RadSortOrder(0)]
    public int C { get; set; }
    [RadSortOrder(1)]
    public int B { get; set; }
}

2. Alternatively, toggle the PropertySort property in the Shown event of the form:
public partial class RadForm1 : RadForm
{
    public RadForm1()
    {
        this.InitializeComponent();
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        this.radPropertyGrid1.EnableSorting = true;
        this.radPropertyGrid1.SelectedObject = new TestObject();
        foreach (var item in this.radPropertyGrid1.Items)
        {
            if (item.Name == "A")
            {
                item.SortOrder = 2;
            }
            else if (item.Name == "B")
            {
                item.SortOrder = 1;
            }
            else
            {
                item.SortOrder = 0;
            }
        }

        this.radPropertyGrid1.PropertySort = PropertySort.NoSort;
    }

    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);

        this.radPropertyGrid1.PropertySort = PropertySort.Alphabetical;
        this.radPropertyGrid1.PropertySort = PropertySort.NoSort;
    }
}

public class TestObject
{
    public int A { get; set; }
    public int C { get; set; }
    public int B { get; set; }
}
Unplanned
Last Updated: 30 Apr 2018 11:26 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: PropertyGrid
Type: Bug Report
1
To reproduce:

    Sub New()

        InitializeComponent()

        Dim intItem As New PropertyStoreItem(GetType(Integer), "Integer", 1)
        Dim floatItem As New PropertyStoreItem(GetType(Single), "Float", 1.0F, "Property storing a floating point value.")
        Dim stringItem As New PropertyStoreItem(GetType(String), "String", "telerik", "Property storing a string value", "Telerik")
        Dim fontItem As New PropertyStoreItem(GetType(Font), "Font", New Font("Arial", 12, FontStyle.Italic), "Property containing Font value")

        fontItem.Attributes.Add(New ReadOnlyAttribute(True))
        floatItem.Attributes.Add(New ReadOnlyAttribute(True))
        Dim store As New RadPropertyStore
        store.Add(intItem)
        store.Add(floatItem)
        store.Add(stringItem)
        store.Add(fontItem)
        Me.RadPropertyGrid1.SelectedObject = store
    End Sub

Try to edit either the "Float" or the "Font" property. The editor will be activated although it doesn't have to.

Workaround: cancel the Editing event

    Private Sub RadPropertyGrid1_Editing(sender As Object, e As PropertyGridItemEditingEventArgs)
        If e.Item.Name = "Font" Then
            e.Cancel = True
        End If 
    End Sub
Unplanned
Last Updated: 20 Mar 2018 08:26 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: PropertyGrid
Type: Bug Report
1
Use attached to reproduce.
- Type 'n' in the search bar 
- "Name" is not found

Unplanned
Last Updated: 19 Jan 2018 13:24 by ADMIN
How to reproduce: run the attached project on a system with an increased scaling - 200%
Unplanned
Last Updated: 15 Aug 2017 10:02 by ADMIN
Workaround:

public class CustomPropertyGrid : RadPropertyGrid
{
    public override string ThemeClassName  
    { 
        get 
        { 
            return typeof(RadPropertyGrid).FullName;  
        }
    }

    protected override PropertyGridElement CreatePropertyGridElement()
    {
        return new CustomPropertyGridElement();
    }
}

public class CustomPropertyGridElement : PropertyGridElement
{
    protected override Type ThemeEffectiveType     
    { 
        get    
        { 
            return typeof(PropertyGridElement);     
        }
    }

    protected override PropertyGridSplitElement CreateSplitElement()
    {
        return new CustomPropertyGridSplitElement();
    }
}

public class CustomPropertyGridSplitElement : PropertyGridSplitElement
{
    protected override Type ThemeEffectiveType     
    { 
        get    
        { 
            return typeof(PropertyGridSplitElement);     
        }
    }

    protected override PropertyGridTableElement CreateTableElement()
    {
        return new CustomPropertyGridTableElement();
    }
}

public class CustomPropertyGridTableElement:PropertyGridTableElement
{
    protected override Type ThemeEffectiveType     
    { 
        get    
        { 
            return typeof(PropertyGridTableElement);     
        }
    }

    public override bool ProcessKeyDown(KeyEventArgs e)
    {
        if (e.KeyData == Keys.Enter && ((PropertyGridItem)this.SelectedGridItem).PropertyType == typeof(bool))
        {
            PropertyGridItem item = this.SelectedGridItem as PropertyGridItem;
            item.Value = !(bool)item.Value;
            return true;
        }
        return base.ProcessKeyDown(e);
    }
}
Unplanned
Last Updated: 15 Aug 2017 09:33 by ADMIN
Currently editors not shown as dialog do not work as the RadPropertyGrid editor is closed when focus is transferred to the dialog form.
Unplanned
Last Updated: 04 Oct 2016 08:00 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radPropertyGrid1.SelectedObject = new Item(123,"Item123",DateTime.Now.AddDays(20));
    this.radPropertyGrid1.EditorInitialized += radPropertyGrid1_EditorInitialized;
}

private void radPropertyGrid1_EditorInitialized(object sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridDateTimeEditor propertyGridDateTimeEditor = e.Editor as PropertyGridDateTimeEditor;
    if (propertyGridDateTimeEditor != null)
    {              
        BaseDateTimeEditorElement dateTimeEditorElement = propertyGridDateTimeEditor.EditorElement as BaseDateTimeEditorElement;
        if (dateTimeEditorElement != null)
        {
            dateTimeEditorElement.Format = DateTimePickerFormat.Long;
    
            dateTimeEditorElement.ShowTimePicker = true;
            var radDateTimePickerCalendar = dateTimeEditorElement.CurrentBehavior as RadDateTimePickerCalendar;
            if (radDateTimePickerCalendar != null)
            { 
                radDateTimePickerCalendar.DropDownMinSize = new System.Drawing.Size(600, 400);
            }
        }
    }
} 

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

    public string Name { get; set; }

    public DateTime Date { get; set; }

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

Workaround:

private void radPropertyGrid1_EditorInitialized(object sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridDateTimeEditor propertyGridDateTimeEditor = e.Editor as PropertyGridDateTimeEditor;
    if (propertyGridDateTimeEditor != null)
    {              
        BaseDateTimeEditorElement dateTimeEditorElement = propertyGridDateTimeEditor.EditorElement as BaseDateTimeEditorElement;
        if (dateTimeEditorElement != null)
        {
            dateTimeEditorElement.Format = DateTimePickerFormat.Long;
    
            dateTimeEditorElement.ShowTimePicker = true;
            var radDateTimePickerCalendar = dateTimeEditorElement.CurrentBehavior as RadDateTimePickerCalendar;
            if (radDateTimePickerCalendar != null)
            {
                radDateTimePickerCalendar.PopupControl.PopupOpened-=PopupControl_PopupOpened;
                radDateTimePickerCalendar.PopupControl.PopupOpened+=PopupControl_PopupOpened;
            }
        }
    }
}

private void PopupControl_PopupOpened(object sender, EventArgs args)
{
    RadDateTimePickerDropDown dropdown = sender as RadDateTimePickerDropDown;
    dropdown.MinimumSize = new Size(600, 300);
}
Unplanned
Last Updated: 27 Jun 2016 12:12 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: PropertyGrid
Type: Bug Report
1

			
Unplanned
Last Updated: 30 Mar 2016 10:45 by ADMIN
To reproduce:

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

    this.radPropertyGrid1.ContextMenuOpening += radPropertyGrid1_ContextMenuOpening;
}

private void radPropertyGrid1_ContextMenuOpening(object sender, Telerik.WinControls.UI.PropertyGridContextMenuOpeningEventArgs e)
{
    foreach (RadItem item in e.Menu.Items)
    {
        if (item.Text == "Sort")
        {
            item.Visibility = ElementVisibility.Collapsed;
            item.PropertyChanged += item_PropertyChanged;
        }
    }
}

Workaround:
private void radPropertyGrid1_ContextMenuOpening(object sender, Telerik.WinControls.UI.PropertyGridContextMenuOpeningEventArgs e)
{
    RadItem item = null;
    for (int i = 0; i < e.Menu.Items.Count; i++)
    {
        item = e.Menu.Items[i];
        if (item.Text=="Sort")
        {
            e.Menu.Items.Remove(item);
        }
    } 
}
Unplanned
Last Updated: 30 Mar 2016 10:09 by ADMIN
To reproduce: Use the following code snippet and perform the step illustrating on the attached gif file. Note that this undesired behavior appears randomly.
Partial Public Class Form1
Inherits Telerik.WinControls.UI.RadForm

    Public Sub New()
        InitializeComponent()
        radPropertyGrid1.PropertySort = Windows.Forms.PropertySort.Categorized
        radPropertyGrid1.SortOrder = Windows.Forms.SortOrder.None
         
        Dim metaDocItem As New PropertyStoreItem(GetType(String), "Document ID", "16.0", "Document ID Number", "Meta Data", True)
        Dim fileInfoItem As New PropertyStoreItem(GetType(FileInfo), "File Info", New FileInfo("sample file path", "file name path"), _
                                                  "", "Meta Data", True)
        fileInfoItem.Attributes.Add(New TypeConverterAttribute(GetType(MyDataConverter)))
        Dim stringItem As New PropertyStoreItem(GetType(String), "String", "telerik", "Property storing a string value", "Meta Data", True)
        Dim dockItem As New PropertyStoreItem(GetType(DockStyle), "Dock", DockStyle.Top, "Property containing DockStyle value", "Meta Data", True)

        Dim store As New RadPropertyStore
        store.Add(metaDocItem)
        store.Add(fileInfoItem)
        store.Add(stringItem)
        store.Add(dockItem)
        Me.RadPropertyGrid1.SelectedObject = store
    End Sub
End Class
 
Public Class FileInfo
    Private _filePath As String
    Private _fileName As String

    Public Sub New(filePath As String, fileName As String)
        Me._filePath = filePath
        Me._fileName = fileName
    End Sub

    Public ReadOnly Property FilePath() As String
        Get
            Return _filePath
        End Get
    End Property

    Public ReadOnly Property FileName() As String
        Get
            Return _fileName
        End Get
    End Property
End Class

Public Class MyDataConverter
Inherits ExpandableObjectConverter
    Public Overrides Function CanConvertTo(context As ITypeDescriptorContext, destinationType As Type) As Boolean
        If destinationType = GetType(String) Then
            Return True
        End If
        Return MyBase.CanConvertTo(context, destinationType)
    End Function
    Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As System.Globalization.CultureInfo, _
                                        value As Object, destinationType As Type) As Object
        If destinationType <> GetType(String) Then
            Return MyBase.ConvertTo(context, culture, value, destinationType)
        End If
        Return String.Empty
    End Function 
End Class

Workaround: add a RadSortOrderAttribute to each PropertyStoreItem and leave the default  SortOrder = Windows.Forms.SortOrder.Ascending
Unplanned
Last Updated: 30 Mar 2016 10:06 by ADMIN
To reproduce:
Open VisualStyleBuilder and navigate to RadGanttView -> RadGanttViewElement and try to edit the Value of the BackgroundImageLayout and ImageLayout properties.


Workaround:
Edit the value manually, as a string