Please run the attached sample project and refer to the attached screenshots. RadPropertyGrid doesn't respect the Description attribute. this.radPropertyGrid1.SelectedObject = new Item(123,"Item", ExposureMode.FullAuto); public class Item { public int Id { get; set; } public string Name { get; set; } public ExposureMode Mode { get; set; } public Item(int id, string name, ExposureMode mode) { this.Id = id; this.Name = name; this.Mode = mode; } } public enum ExposureMode { [Description("Full Auto")] FullAuto, [Description("Auto Filter, Fixed Exposure")] AutoFilFixedExp, [Description("Fixed Filter, Auto Exposure")] FixedFilAutoExp, [Description("Fixed Filter, Fixed Exposure")] FullFixed }
Generic collections are used by entity framework to contain child objects. UPDATE: RadPropertygrid uses the standard System.ComponentMode.Design.CollectionEditor when editing collections. The editor requirements are that the collection being edited implements the IList interface and that it has an indexer (Item in VB.NET) property. Entity Framework generates an ICollection<T> property which holds a HasSet<T> object. This does not fit both requirements of the editor and prevents it from working correctly.
Developers should be able to validate user input in the RadPropertyStore items. UPDATE: Currently we have decided to stick with the current implementation where all the validation is done through the PropertyValidating/ed events.
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!
1. Create a custom property item
2. Enable grouping
3.Scroll up and down
4.NullReferenceException occurs
Office2010silver theme showing different result with 2017.2.613 version my font size became very small.
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; } }