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.
To reproduce: - Create a property store and add some items to it. - Start the project and click an item. Workaround: - Add RadSortOrderAttribute to each item: for (int i = 0; i < propStore.Count; i++) { PropertyStoreItem item = propStore[i]; item.Attributes.Add(new RadSortOrderAttribute(i)); }
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.
When the TypeConverter of a property cannot convert from string the text box editor that opens for this property should be read only.
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.
RadPropertyGrid - when default value attribute is Color.Empty, the items is styled with bold font and "Modified" icon. Workaround: Use ItemFormatting event to style the item correctly. Code to reproduce: public class TestObj { private Color someColor; public TestObj() { this.someColor = Color.Empty; } [DefaultValue(typeof(Color), "Empty")] public Color SomeColor { get { return someColor; } set { someColor = value; } } } TestObj newObj = new TestObj(); this.radPropertyGrid1.SelectedObject = newObj;
Extend the sorting functionality in order to support custom sort order.
To reproduce: - Click on a property (with a dropdown editor for example) to start edit. - Move mouse over vertical center dividing line to get mouse to transition to resize pointer. - Move mouse to the right back over the combo box that has been activated for edit. - The mouse pointer will not transition back to the arrow, it will stay on the resize pointer.
To reproduce: -add a RadPropertyGrid and use the following code: radPropertyGrid.SelectedObject = new MyPropertyGridAdapter(node); PropertyValueChanging += new PropertyGridItemValueChangingEventHandler(OnPropertyValueChanging); private void OnPropertyValueChanging(object sender, PropertyGridItemValueChangingEventArgs e) { var form = new CommentActionForm(); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var item = e.Item as PropertyGridItem; var pd = item.PropertyDescriptor as MyPropertyDescriptor; if (pd != null) { // Perform value change (affects database). } } else { e.Cancel = true; } } Workaround:when ending edit mode with Enter key you may use the following approach: public Form1() { InitializeComponent(); this.radPropertyGrid1.SelectedObject = new MyObject(10204, "Sample name", "Some descripion"); this.radPropertyGrid1.EditorRequired += radPropertyGrid1_EditorRequired; } private void radPropertyGrid1_EditorRequired(object sender, PropertyGridEditorRequiredEventArgs e) { PropertyGridItem propertyItem = e.Item as PropertyGridItem; e.Editor = new MyEditor(propertyItem); } public class MyObject { public int ID { get; set; } public string Name { get; set; } public string Description { get; set; } public MyObject(int iD, string name, string description) { this.ID = iD; this.Name = name; this.Description = description; } } public class MyEditor : PropertyGridTextBoxEditor { public string InitialValue { get; set; } public PropertyGridItem PropertyItem { get; set; } public MyEditor(PropertyGridItem item) : base() { this.PropertyItem = item; } public override void BeginEdit() { InitialValue = this.TextBoxEditorElement.Text; base.BeginEdit(); } } public class MyPropertyGrid : RadPropertyGrid { protected override bool ProcessDialogKey(Keys keyData) { if (this.ActiveEditor != null && this.ActiveEditor is MyEditor && keyData == Keys.Enter) { MyEditor editor = ((MyEditor)this.ActiveEditor); PropertyGridItem property = editor.PropertyItem; string initialValue = editor.InitialValue; DialogResult ds = RadMessageBox.Show("Are you sure?", "Title", MessageBoxButtons.OKCancel, RadMessageIcon.Question); if (ds == System.Windows.Forms.DialogResult.Cancel) { property.Value = initialValue; return false; } } return base.ProcessDialogKey(keyData); } }
To reproduce, use the following class: public class NullableDummy { public bool? Bool { get; set; } public byte? Byte { get; set; } public char? Char { get; set; } public decimal? Decimal { get; set; } public float? Float { get; set; } public int? Int { get; set; } public long? Long { get; set; } public sbyte? Sbyte { get; set; } public short? Short { get; set; } public string String { get; set; } public ulong? Ulong { get; set; } public ushort? Ushort{ get; set; } } And set it as a selected object of the property grid: NullableDummy dummy = new NullableDummy(); this.propertyGrid.SelectedObject = dummy; Change the Byte Property you will see that the value is not being set.
Steps to reproduce: 1. Add a RadPropertyGrid to a form 2. Set the SelectedObject property to an object with numeric property 3. Open the numeric property for edit and click the arrow buttons to change the value. 4. Click on another control that can take focus e.g. the form control box buttons You will see that the editor remains open.
To reproduce - create a form with a RadPropertyGrid. - set ToolbarVisible to true - add some properties, but not enough to cause the scrollbar to appear. - start and click on the sort button: the sort is changed, but the scroll bar became visible even if it is not needed. Workaround: public class MyPropGrid : RadPropertyGrid { protected override PropertyGridElement CreatePropertyGridElement() { return new MyPropGridElement(); } public override string ThemeClassName { get { return typeof(RadPropertyGrid).FullName; } set { } } } public class MyPropGridElement : PropertyGridElement { protected override PropertyGridSplitElement CreateSplitElement() { return new MyPropGridSplitElement(); } protected override Type ThemeEffectiveType { get { return typeof(PropertyGridElement); } } } public class MyPropGridSplitElement : PropertyGridSplitElement { protected override PropertyGridTableElement CreateTableElement() { return new MyPropGridTableElemnet(); } protected override Type ThemeEffectiveType { get { return typeof(PropertyGridSplitElement); } } } public class MyPropGridTableElemnet : PropertyGridTableElement { protected override void UpdateScrollers(UpdateActions updateAction) { this.Scroller.UpdateScrollRange(); } protected override Type ThemeEffectiveType { get { return typeof(PropertyGridTableElement); } } }
More specifically the behavior when the combobox editor is double clicked it changes its current item to the next one.
To reproduce: - Create a PropertyGrid and initialize it like this: PropertyStoreItem checkboxItem = new PropertyStoreItem(typeof(bool), "Checkbox", true); _store = new RadPropertyStore(); _store.Add(checkboxItem); this.radPropertyGrid1.SelectedObject = _store; -change the store item first to null then to false Workaround: -Before you set the item value to false set it to true first like this: item.Value = null; //set first to true then to false item.Value = true; item.Value = false;
To reproduce: List<PropertyStoreItem> propertyStoreItems = new List<PropertyStoreItem>(); propertyStoreItems.Add(modelItem); RadPropertyStore store = new RadPropertyStore(); store.AddRange(propertyStoreItems); Workaround: Iterate the collection and use the Add method foreach (var item in propertyStoreItems) { store.Add(item); }
Currently when one filters properties through the Search bar they are filtered based on their Name instead of the display name or label.
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.
Steps to reproduce: 1. Add a RadPropertyGrid to a form. 2. Set the SelectedObjects property to a array of one object that has a property decorated with the ReadOnly attribute. Run the project and you will see that the read only property is not displayed.
Pressing Ctrl + Enter should create a new row in the editor instead of closing it. WORKAROUND: Replace the default editor with the following one in the EditorRequired event: class MyPropertyGridTextBoxEditor : PropertyGridTextBoxEditor { protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e) { if (e.Modifiers == System.Windows.Forms.Keys.Control && e.KeyCode == System.Windows.Forms.Keys.Enter) { return; } base.OnKeyDown(e); } }
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 = "";