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.
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.