"WOW!!! That’s quick! Recently I had to wait almost 2 months for a bugfix from [...] and here I am getting almost next day delivery of a shyly proposed feature. This is called a good customer support! [...] If you are going to create any other high quality controls that are well written and simply work, GRL will be the first to buy them. The controls available on the internet are usually very badly designed, often written by amateurs and even if they are developed by a professional company, they are not really user friendly and have lots of bugs."
VisualHint and
Skybound
have reached agreement on a technical partnership where both companies can share their expertise and code. The first impact for Smart PropertyGrid.Net is to allow better XP theme rendering for .Net 1.1 and 2.0 as well as the support of their incredible VisualTips which represent a must-have feature along value validation. Check Skybound products! They can be used for free or based on a premium subscription.
If you skin your application with famous themes like Office 2007 (blue, black, silver), Office 2003 or Vista, you will be happy to know that SPG.Net now offers these themes too. Here is a (resized) screenshot:
This is feasible thanks to the Krypton Toolkit API (which is a free framework available here). Instead of reinventing the wheel, I contacted Phil Wright to learn more about his toolkit and I learnt that his assembly could be used only to skin custom controls. So I have just created a custom SPG drawing manager: KryptonDrawingManager.cs. It uses all the known themes of the toolkit and you can even design your own palettes.
A visitor who wanted to evaluate SPG asked me this question the other day: "I want to build a view to compare two objects visually. I want to display two property grids, one for each object. But these grids must be visually sync'ed. If user expands or collapses one property or category, other grid must do the same. If user scrolls, other must scroll too. It is possible with your component?". The answer is yes with SPG 3.0.1 and I have made a screencast to show you the result:
The synchronizer class can be downloaded here (please, let me know if you find any issue with this class, I will be happy to fix it).
Now that SFPE 1.1 has been released, better than a thousand words, here is a short screencast to showcase its new features:
Also here is the changelog:
Version 1.1:
New features:
A convenient latitude/longitude editor has been added to wrap LatLongFieldPacks. What makes it exceptional is that it accepts values as float, double, decimal and corresponding nullable types and it can even be given your own latitude/longitude type as long as it is IConvertible to decimal or an attached TypeConverter can make the conversion.
The latitude/longitude editor has a new inplace control for Smart PropertyGrid.
The latitude/longitude editor can display its value as deg.fraction, deg min.fraction or deg min sec.fraction, with the fraction being optional.
The IpAddress editor has a new inplace control for Smart PropertyGrid. It can be attached to a string or uint property type.
Field.Readonly is now handled (behaviour and ForeColor). A ReadOnly field can still be selected. If you don't want so, just set Field.Selectable to false.
FieldPackEditor.ReadonlyForeColor has been added.
DateTimeCustomFormatConverter has been set to the DateTimePicker.CustomFormat property so that it lists all standard format strings.
There is now a simple way to set any field pack to accept the delete key or not, to nullify its content. Call the AcceptsDeleteKey property on the supplied editors or more specifically on individual field packs. The SpgSfpeAdapter also provides an attribute (FieldPackAcceptsDeleteKeyAttribute).
The visibility of the checkbox, updown and dropdown buttons can now be set through the look class in Smart PropertyGrid.
A month name field can now be edited with a numeric value (typing 2 will give february).
Jumping to the next field can now be done with the blank key or the first letter/sign of the adjacent static field.
Bug fixes:
When an editor was inside Smart PropertyGrid, its value was not commited if the user was in the middle of typing in a field.
The up/down buttons were not effective when the user was in the middle of typing in a field.
Better detection of a separator in the datetime format string. There was a problem when the user was typing a separator char prefixed by another static field.
In an editor showing the time in 12h format with an AP/PM designator, changing the hour field could incorrectly change the AM/PM designator.
Then management of the temporary buffer used while typing in a field has been enhanced.
I am proud to unveil today the first beta release of Smart PropertyGrid.Net 3.0. This release is impressive by the number of improvements and changes and I will give you here the main details:
There was a real demand for it so I implemented it, making SPG the only PropertyGrid supporting this feature! As already advertised in this blog before, SPG now supports right to left languages. And not in a minimal way: each component of the grid, from the main display to each inplace control, is properly mirrored. Here is a screenshot with hebrew strings displayed:
It is good to be lazy sometimes so I decided to add some lazyness to SPG. So far, simply to keep it simple, the grid was recursively loading all properties of a target instance. It has been reported that it could be costly for large contents or even worse it could lead to a crash if there was a cyclic property path. The Microsoft PropertyGrid was able to handle these situations so there was no reason to let SPG behind. That's why I added a LazyLoading mode where child properties will be loaded only when a parent is expanded.
Icons in front of property values are now consistently managed, which lets you add any descriptive or status information with a value. You have many options to choose your image: it can come from a global image list, a property specific image list (usually when the property publishes standard values) or directly from an image reference.
The next feature comes from a single customer request but I found it so smart that I was sure everyone would love it too. This is incremental search (aka auto-complete) which enables you to quickly set a new value to a property when it publishes a set of standard values. The original idea here is that you get this feature in textboxes, in dropdown lists and even in existing UITypeEditors (like the ColorEditor) when listboxes are detected. This is a terrific usability feature for your customers!
I never was interested by this feature but many of you were asking for it and now that it is implemented I am not unhappy to see it in action. SPG, like the Microsoft PropertyGrid before, now displays non default values with a bold font. A value is "non default" when it's different from the one that is registered with a DefaultValueAttribute or when a ShouldSerialize method exists and returns true.
You found that the alpha color picker was a nice addition to SPG but you were concerned by its "private" nature. Well, you can now derive from it and override many virtual methods. Choosing to show the alpha component or not is also a built-in feature.
All these major features are showcased in the modified supplied sample. To see the full list of enhancements and fixes, simply consult the changelog.
I know, VisualHint’s blog has been quiet for some time now, simply because internal activity has increased and the next version of SPG and SFPE are in the starting blocks. In the next days/weeks, you will see again that a lot is actually happening under the hood. Here are the next events at VisualHint:
SPG 3.0, which is already available as a preview for customers, will be published as a public beta as soon as I have updated the documentation. Here is a (resized) screenshot of the revamped supplied sample:
SFPE 1.1, which is already in beta, will be officially released.
I will often post here to explain what's new in both products. Expect some screencasts inside.
Did you know that the Microsoft PropertyGrid is not able to let the user set a common value for collections coming from multiple target instances? Take a list or an array, this is the same story. The CollectionEditor will popup, you will alter the displayed collection and when you hit OK, nothing happens. Well, up to last week, this was the same in SPG. But with the new build, you can now edit collections when you target multiple instances with SelectedObjects. Here is a screencast to see it live:
When I decided to fix the behavior of the grid regarding multiple target instances, I though it would be difficult and that after a lot of efforts it would produce a release perceived as minor (something that should be version 2.2.6) because this feature should have worked from the beginning or at least from version 2.0. So I gathered my courage and began investigating. I still learned a lot during the process and I realized that I could do better than what the Microsoft PropertyGrid does when it targets several instances.
The Microsoft grid is lost as soon as you target two instances that have common properties but whose values differ. From my point of view, this is not logical so I did my best to fix this behavior and I succeeded (there are some screencasts about this subject). The result is a release that you can consider major, and therefore labelled 2.5. Moreover I took the chance to add some very demanded features. Here are the more important points of the changelog:
SelectedObjects has been reworked and SPG now behaves correctly regarding multiple instances. It even allows comparisons of immutable properties (the one whose TypeConverter's CreateInstanceSupported returns true) having different values.
Displayed values (set by PropertyValue.ResetDisplayedValues or by the PropertyValueDisplayedAsAttribute) are more flexible. Before you could only set them as strings. You can now supply objects or pairs
Trackbars now accept to target integer, float, double and decimal property types.
Ctrl+Enter in a multiline textbox inserts a new line.
By default, a listbox uses the same visuals (font, fore and back colors) than the property value. It is now possible to break this synchronization and let the listbox use the normal colors used by the grid. This is done by using the DropDownListboxVisuals attribute.
The List feel can use a cache for properties showing a costly content that should not be recreated each time the listbox is displayed. To configure a property in such a way, mark it with UseFeelCacheAttribute. The cache can be emptied by setting PropertyValue.FeelCache to null.
The Unit inplace control now takes into consideration a unit with a single value (a collection with a unique possible value or a simple string). In this case, no dropdown is shown and the value is just displayed as a static information.
For list feels, the resize box can be removed by setting the PropInPlaceList.PreventResizable to true (from the InPlaceCtrlVisible event handler).
I hope you will like this this verson as much as I worked on it. If you have any question, if you are not sure what SPG can do for you or if it does a particular thing, don't hesitate: contact me.
This was a long time requested feature: being able to attach a trackbar feel to any type of numerical value. As a last minute surprise in SPG 2.5 (which is in beta), I implemented it for integers, floats, doubles and decimals (it’s ready for more but let’s see what you actually need in the future). The feel still needs a PropertyValidator attached to it so that it can have the minimum and maximum values. There is also a new attribute (TrackBarSettings) to set the Resolution (new notion for floating point numbers) the SmallChange and LargeChange properties.
Since at the same time, a customer had troubles with a property of type PointF and its associated TypeConverter, I updated the sample with such a property showing the new trackbar for the X and Y child properties. Here is a screenshot of this nice arrangement:
If you need the PointF TypeConverter, feel free to download it. It is simply based on its counterpart for the Point structure.