Telerik blogs

Q3 2011 release is getting close and we are eager to share some of the improvements that we have been working on lately. We have always been relying on your feedback to better shape our tools for your purposes. This time it is no different. RadPropertyGrid will get three highly requested features.

The first feature will allow you to add custom items in the RadPropertyGrid by using RadPropertyStore. It is a collection of PropertyStoreItems which contain information that describes a property, its type, name, value, etc. When the RadPropertyStore is set to the SelectedObject property of the RadPropertyGrid, it displays these items as properties. You can then add, remove items or you can edit the values of the items during runtime and everything will be reflected in the RadPropertyGrid immediately.

RadPropertyStore store = new RadPropertyStore();
  
PropertyStoreItem intItem = new PropertyStoreItem(typeof(int), "Integer", 1, "Integer property.", "Numbers", false);
PropertyStoreItem floatItem = new PropertyStoreItem(typeof(float), "Float", 1f, "Property storing a floating point value.", "Numbers", true);
PropertyStoreItem boolItem = new PropertyStoreItem(typeof(bool), "Boolean", true, "Boolean property.", "Boolean", false);
PropertyStoreItem stringItem = new PropertyStoreItem(typeof(string), "String", "telerik", "Property storing a string value.", "Telerik", true);
PropertyStoreItem dockItem = new PropertyStoreItem(typeof(DockStyle), "Dock", DockStyle.Top, "Property containing DockStyle value.", "Layout", false);
  
store.Add(intItem);
store.Add(floatItem);
store.Add(boolItem);
store.Add(stringItem);
store.Add(dockItem);
  
this.radPropertyGrid1.SelectedObject = store;

 

Rad PropertyGrid for WinForms Property Store

 

The second feature will allow you to select multiple objects. You will be able set an array of objects to the RadPropertyGrid SelectedObjects property and it will display the common properties between these objects. Common properties are considered properties with the same name and type. When you use this feature, the property grid will display values only for the common properties that have the same value in all objects. Those properties that have different values in different objects will be displayed with no value. Editing a property will result in the value being set to each object in the selected objects array.

Rad PropertyGrid for WinForms Editors

 

Last, but not least, we have been working on our editors. As a result, as you can see in the screenshot above, now you can use a check box editor for the Boolean properties. The check box editor is always visible which means that you can edit Boolean properties directly, without first having to open an editor. We have also enhanced the ProperyGridItems that display color properties. They now have a rectangle inside them which displays the current color. In addition, we have added support for UITypeEditors. They are used in the cases, where we do not provide our own editor and where the particular property has such an editor assigned to edit it. Here are a few types that have UITypeEditor: DockStyle, Anchor, ContentAlignment.

Stay tuned for more information about the upcoming RadControls for WinForms enhancements!

Happy conding!


About the Author

Nikolay Diyanov

Diyanov is the Product Manager of the Native Mobile UI division at Progress. Delivering outstanding solutions that make developers' lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.

Find him on Twitter @n_diyanov or on LinkedIn.

Comments

Comments are disabled in preview mode.