To reproduce: please refer to the attached gif file. The error is not reproduced each time with the Demo application. Sometimes an unhandled exception dialog appears and sometimes the application becomes unresponsive and you can not close the application with upper right X, the options to the right does not respond, you can not change demo using the list on the left. Selecting "Settings" in Property Grid section and then clicking on a boolean property (left column), scrolling using the mouse wheel, then selecting another property (with PropertyGridDropDownListEditor) or clicking around in the application (even outside of the property grid form). Workaround: this.radPropertyGrid1.EditorRequired += radPropertyGrid1_EditorRequired; private void radPropertyGrid1_EditorRequired(object sender, PropertyGridEditorRequiredEventArgs e) { if (e.EditorType == typeof(PropertyGridDropDownListEditor)) { e.Editor = new CustomPropertyGridDropDownListEditor(); } } public class CustomPropertyGridDropDownListEditor : PropertyGridDropDownListEditor { public override object Value { get { PropertyGridItemElement element = this.OwnerElement as PropertyGridItemElement; PropertyGridItem item = element.Data as PropertyGridItem; if (item == null) { return null; } return base.Value; } set { base.Value = value; } } }
The RadPropertyGrid columns should be able to auto resize according to their cells content.
To reproduce: use the following code snippet and refer to the attached gif file: public Form1() { InitializeComponent(); this.radPropertyGrid1.SelectedObject = this; } private void radButton1_Click(object sender, EventArgs e) { ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Dark"; } private void radButton2_Click(object sender, EventArgs e) { ThemeResolutionService.ApplicationThemeName = "ControlDefault"; } Workaround: private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e) { PropertyGridTextBoxEditor editor = e.Editor as PropertyGridTextBoxEditor; if (editor != null) { BaseTextBoxEditorElement el = editor.EditorElement as BaseTextBoxEditorElement; if (el != null) { el.BackColor = Color.Black; } } }
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
Add the ability for custom sorting in the RadPropertyGrid.
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.
Workaround use the attached custom theme: http://docs.telerik.com/devtools/winforms/themes/using-custom-themes
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 }
To reproduce: use the following code snippet and follow the steps from the gif file: PropertyStoreItem item1 = new PropertyStoreItem(typeof(string), "Test1", "Test1"); PropertyStoreItem item2 = new PropertyStoreItem(typeof(string), "Test2", "Test2"); RadPropertyStore store = new RadPropertyStore(); store.Add(item1); store.Add(item2); this.radPropertyGrid1.SelectedObject = store; this.radPropertyGrid1.ToolbarVisible = true; Workaround: close the editor programmatically when the search box gets focus. this.radPropertyGrid1.PropertyGridElement.ToolbarElement.SearchTextBoxElement.TextBoxItem.GotFocus += TextBoxItem_GotFocus; private void TextBoxItem_GotFocus(object sender, EventArgs e) { this.radPropertyGrid1.EndEdit(); }
To reproduce: run the attached sample project and follow the steps from the gif file. Workaround: cancel the edit operation when handling the MouseDown event of RadPropertyGrid: private void radPropertyGrid1_MouseDown(object sender, MouseEventArgs e) { var elementUnderMouse = this.radPropertyGrid1.ElementTree.GetElementAtPoint(e.Location).FindAncestor<RadScrollBarElement>(); if (elementUnderMouse!=null) { this.radPropertyGrid1.CancelEdit(); } }
Steps to reproduce: 1. Add a RadPropertyGrid to a form 2. Set the SelectedObject property to an object with an enum property 3. Open the enum property for edit. 4. Click on another control that can take focus e.g. the form control box buttons You will see that the editor remains open.
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.
Currently editors not shown as dialog do not work as the RadPropertyGrid editor is closed when focus is transferred to the dialog form.
Currently users can only specify a UITypeEditor. They should be able to specify which BaseInputEditor to be used for a given property when they edit it: [Editor(typeof(PropertyGridBrowseEditor), typeof(BaseInputEditor)] public string FilePath { get; set; }
Currently RadPropertyGrid does not handle the GetStandardValues method.
To reproduce: public Form1() { InitializeComponent(); PropertyStoreItem intItem = new PropertyStoreItem(typeof(int), "Integer", 1); PropertyStoreItem floatItem = new PropertyStoreItem(typeof(float), "Float", 1f, "Property storing a floating point value."); PropertyStoreItem stringItem = new PropertyStoreItem(typeof(string), "String", "telerik", "Property storing a string value", "Telerik"); PropertyStoreItem dockItem = new PropertyStoreItem(typeof(DockStyle), "Dock", DockStyle.Top, "Property containing DockStyle value", "Layout", false); RadPropertyStore store = new RadPropertyStore(); store.Add(intItem); store.Add(floatItem); store.Add(stringItem); store.Add(dockItem); this.radPropertyGrid1.SelectedObject = store; } private void radButton1_Click(object sender, EventArgs e) { PropertyStoreItem intItem = new PropertyStoreItem(typeof(int), "Integer111", 1); PropertyStoreItem floatItem = new PropertyStoreItem(typeof(float), "Float111", 1f, "Property storing a floating point value.111"); PropertyStoreItem stringItem = new PropertyStoreItem(typeof(string), "String111", "telerik", "Property storing a string value", "Telerik111"); PropertyStoreItem dockItem = new PropertyStoreItem(typeof(DockStyle), "Dock111", DockStyle.Top, "Property containing DockStyle value", "Layout111", false); RadPropertyStore store = new RadPropertyStore(); store.Add(intItem); store.Add(floatItem); store.Add(stringItem); store.Add(dockItem); this.radPropertyGrid1.SelectedObject = store; } WORKAOUND: radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.TitleText = ""; radPropertyGrid1.PropertyGridElement.SplitElement.HelpElement.ContentText = "";
ADD. RadPropertyGrid - add custom grouping functionality
1. Drag a new RadPropertyGrid to a form. 2. Set the selected object property to any object 3. Add an event handler for the PropertyValueChanged event and add code in it that sets the same object as selected object of the property grid. 4. You will get a NullReferenceException
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.