Use attached to reproduce. Workaround radPropertyGrid1.ItemSpacing = 1;
To reproduce: this.radPropertyGrid1.SelectedObject = this; this.radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.MinSize = new Size(0, 60); Please refer to the attached gif file. Workaround: this.radPropertyGrid1.SelectedObject = this; this.radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.MinSize = new Size(0, 60); this.radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.HelpTitleElement.MinSize = new Size(0,20); this.radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.HelpTitleElement.PropertyChanged += HelpTitleElement_PropertyChanged; private void HelpTitleElement_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Bounds") { if (this.radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.HelpContentElement.Location.Y != 20) { this.radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.HelpContentElement.Location = new Point(0, 20); } } } Note: the description element may be floating but it doesn't overlap the title.
How to reproduce: associate the control with an object having a Font property. It can be the form itself, then try and change the font-size, e.g: -1. The standard property grid displays a message box with the error. Workaround handle the RadPropertyGrid.EditorInitialized event: private void RadPropertyGrid_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor; if (editor != null && e.Item.Parent != null && e.Item.Parent.Name == "Font" && e.Item.Name == "Size") { editor.MinValue = 1; } }
When setting multiple objects or a mix of objects, some of which implement the INotifyPropertyChanged interface changes in these objects should be reflected in the RadPropertyGrid.
When editing a DateTime? property the property grid shows a text box editor instead of calendar.
Use the editor from the following article to reproduce: https://docs.telerik.com/devtools/winforms/propertygrid/editors/using-custom-editor Workaround: void TrackBarEditor_ValueChanged(object sender, EventArgs e) { PropertyGridItemElement owner = this.OwnerElement as PropertyGridItemElement; if (owner != null) { var method = owner.PropertyTableElement.GetType().GetMethod("OnValueChanged", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); method.Invoke(owner.PropertyTableElement, new object[] { this, EventArgs.Empty }); } }
Problem: I'd like to filter the properties to be displayed by their category names defined by the Category attribute. Based on the doc here (https://docs.telerik.com/devtools/winforms/controls/propertygrid/features/filtering), my understanding is to add a FilterDescriptor like this: New FilterDescriptor ("Category", FilterOperator.Contains, "some category name"). But it turned out to only filter by property name, not category name. Any misunderstanding or possible issue? Thank you for looking into this.
Reproduce:
1. Define a class like this:
Private Class TestClass
<Category("Cat1")> Public Property Property1 As Integer = 1
<Category("Cat1")> Public Property Property2 As String = "Test 2"
<Category("Cat2")> Public Property Property3 As String = "Test 3"
End Class
2. Initialize a RadPropertyGrid in the Form.Load event:
Dim testObj As New TestClass
RadPropertyGrid1.EnableFiltering = True
Dim filter As New FilterDescriptor("Category", FilterOperator.Contains, "2")
RadPropertyGrid1.FilterDescriptors.Add(filter)
RadPropertyGrid1.SelectedObject = testObj
3. The right property to be displayed should be Property3, but it turned out to be Property2
Example project: attached.
Thank you team!
RadPropertyGrid calls the TypeConverter methods GetStandardValuesSupported and GetStandardValues passing null as parameter when it should pass the property item. Code to reproduce: this.radPropertyGrid1.SelectedObject = new SomeClass(); public class SomeClass { [TypeConverter(typeof(CustomValueConverter))] public string CustomValue { get; set; } } public class CustomValueConverter : TypeConverter { public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { return base.GetStandardValues(context); } }
In some cases when the selected object is changed while a bool property is selected an InvalidCastExceptions is thrown. Check ticket for reproduction steps and project.
1. Create a custom property item
2. Enable grouping
3.Scroll up and down
4.NullReferenceException occurs
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;
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();
}
}
Currently when one filters properties through the Search bar they are filtered based on their Name instead of the display name or label.
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.
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.
To reproduce: public RadForm1() { InitializeComponent(); this.radPropertyGrid1.SelectedObject = new Item("zero", "uniqueId","alpha"); this.radPropertyGrid1.EnableSorting = true; SortDescriptor sort = new SortDescriptor("Value", ListSortDirection.Ascending); this.radPropertyGrid1.SortDescriptors.Add(sort); } public class Item { public string Text { get; set; } public string Identifier { get; set; } public string Value { get; set; } public Item(string text, string identifier, string value) { this.Text = text; this.Identifier = identifier; this.Value = value; } } Workaround#1: Set SortOrder to None this.radPropertyGrid1.SortOrder = SortOrder.None; Workaround#2: use a custom comparer: this.radPropertyGrid1.SortDescriptors.Add(sort); this.radPropertyGrid1.PropertyGridElement.PropertyTableElement.ListSource.CollectionView.Comparer = new MyComparer(); public class MyComparer : IComparer<Telerik.WinControls.UI.PropertyGridItem> { int IComparer<Telerik.WinControls.UI.PropertyGridItem>.Compare(Telerik.WinControls.UI.PropertyGridItem x, Telerik.WinControls.UI.PropertyGridItem y) { if (x.Value != null && y.Value != null) { return x.Value.ToString().CompareTo(y.Value.ToString()); } return 0; } }
Office2010silver theme showing different result with 2017.2.613 version my font size became very small.