At first, there was a restrictive and defective legacy DateTimePicker. Now there is the FieldPackEditor...
Smart FieldPackEditor is a 100% managed framework for creating field-based editors working under .Net 2.0, 3.x and 4.x. It provides:
These screencasts show you what to expect from SFPE:
The Microsoft DateTimePicker has poor usability and a minimalist API. SFPE is its best possible replacement for .Net. Forget about all those unsatisfying solutions based on Microsoft DateTimePicker derived classes or textboxes, masked or not! Instead, use a powerful component designed to furnish your end-users with field based editors. It offers the following features:
It is nullable by setting the Value property to null or DBNull. The Text property can also be set to an empty string. When set to null, an optional custom string can be displayed, e.g. "Type to set" or "No data". The user can also force the content to null. It's up to the developer how this is done ("delete" key press, checkbox or another button with text or a custom image). This screencast, demonstrates the feature from the user point-of-view.
SFPE goes beyond what you expect from DataBinding. The Value and Text properties can, of course, be bound to a data source, but the features do not stop here. Since the component is nullable, there's no problem binding to a nullable column in a grid. Also, each field can be bound independently. This means that the value of the checkbox itself can be controlled by its own boolean column.
A custom editor, implementing IDataGridViewEditingControl, enables you to embed the DateTimePicker in your DataGridView. Your grid gets all the benefits of the editor, including DataBinding with a nullable DateTime column. This screencast (from the initial beta) showcases the perfect integration.
If you also have SPG, a custom feel integrates the DateTimePicker into the PropertyGrid. (This fixes the initial issue of SPG not being able to include the Microsoft DateTimePicker, which is not flexible enough.)
Because the BorderStyle can be set to None and the text offset can be changed, SFPE can be embedded in other 3rd party containers. Contact VisualHint if you have specific requirements.
Unlike the legacy DateTimePicker, SFPE handles all the "Standard DateTime Format Strings" and "Custom DateTime Format Strings". This means you can use for example the RFC1123 pattern (code 'R') or the seconds fraction format specifier (e.g. code 'fff').
All the usual properties determine the appearance of the control. Set the font, the foreground and background color when enabled or disabled, the width of the fields as fixed (like Microsoft DateTimePicker) or variable (displayed as a continuous string), and the separator width between them.
The DateTimePicker has a CultureInfo property that enables any culture to be set on the control. A totally new MonthCalendar (which can be used free without purchasing SFPE) also adopts this culture.
Smart FieldPackEditor supports RTL. This is rare among 3rd party components. Here's what an Israeli customer has to say about it:
I examined the control and let me tell you it is very professionally designed and implemented; way to go! Also the RTL and Hebrew are working great, a feat not easily performed by many professional companies.
The DateTimePicker can natively show: a dropdown button, updown buttons and a checkbox. These are independent and can be shown at will. It's also easy to add your own generic button for a custom function.
Everything has been done to make editing easy for the user:
There was no real TimeSpan editor for .Net before SFPE, no component letting you input a duration in the format your want. SFPE is now the solution.
The classical format used by the TimeSpanConverter class or a more versatile format can be used.
The global maximum value will determine the maximum value of the most significant field. For instance, if the max is set to 2 days and you only show hours and minutes, hours can go up to 48.
A custom editor, implementing IDataGridViewEditingControl, enables you to embed the TimeSpan editor in your DataGridView. Your grid gets all the benefits of the editor, including DataBinding with a nullable column. An adapter also enables this editor in Smart PropertyGrid.Net.
This editor is based on SFPE so you get all the great features of this framework. Like the DateTimePicker, it is nullable. It can display an up/down button for convenience. Auto incrementation/decrementation of the TimeSpan value can happen when a field goes from max to min or vice versa (for instance, 59 seconds incremented to 0 seconds will add a minute to the value). You get a notification when a field is created or reconfigured. This lets you, for example, change a static field from singular to plural.
SFPE is a generic field editor. The base class, FieldPackEditor, is made of field packs, logical units capable of storing a value such as a latitude. Each pack is made of fields, for example the latitude "minute" field . Derive from the pack and field base classes to create the content of a specialized editor. Derive from FieldPackEditor to create a complete solution with methods and properties pertaining to this editor.
SFPE supports the following native features (those mentioned for the DateTimePicker are not repeated here):
Take complete control of the dropdown window (unlike with the Microsoft DateTimePicker). Use an API to open and close the popup as required, and to define its content. For example, change the default month calendar in the DateTimePicker or display a Google map under a latitude/longitude editor.
Manage packs and fields at will. Since they have unique identifiers, you can get a reference on one of them, then perform an operation on it such as selecting it, setting it as read only, or changing its culture or min/max values. Once you get a field, it's easy to navigate to the other fields.
Manage keys at the editor, pack and field levels, easily changing default behaviours. Packs and fields can specify the keys they accept. For example Ctrl+Home will be filtered by the pack (it resets a date to today for example) whereas a digit will be understood by a numeric field.
A special mention for the TAB key: you can let it browse by fields, packs or nothing - handy, for example, for jumping from anywhere in the latitude pack to the first field in the longitude pack.
Rapidly create your own editable numeric fields using a specially defined NumericField base class.
This term means that by the click of a button, the user can replace the editor with a textbox. Use it at your convenience, for example to input a hostname instead of an IP address, an airport code instead of its reference point or a keyword like "yesterday" instead of a date.
To showcase its possibilities, SFPE comes with two ready-to-use editors: an IP address editor, useful in any network type application, and a latitude/longitude editor, useful in any GIS or similar application. These controls benefit from all above mentioned features.