Scenario
The following basic functionality is implemented in the HyperLinkPropertyEditor.Web and HyperLinkPropertyEditor.Win modules:
1. Custom PropertyEditor classes for WinForms and ASP.NET based on the HyperLinkEdit and ASPxHyperLink controls that can be used for representing object fields, containing email address or a URL in the UI.
2. To validate an input, a combined RexEx mask is used in both ListView and DetailView of Windows Forms and ASP.NET applications. The default regular expression is the following:
(((http|https|ftp)\://)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*)|([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})
You can use it as is or modify it per your specific needs. Look for Regular Expressions in MSDN for more information on how to do this.
3. The default email client or default browser window is opened after a single click on the hyperlink if it represents a valid email or web address. For end-users convenience, in DetailView of Windows Forms projects, a double-click is necessary to be able to easily edit the field.
Image may be NSFW.
Clik here to view.
Steps to implement
1. Copy and include the HyperLinkPropertyEditor.Web and HyperLinkPropertyEditor.Win projects into your solution and make sure it is built successfully.
2. Invoke the Application Designer for the YourSolutionName/WinApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the HyperLinkPropertyEditorWindowsFormsModule component into the modules list on the left.
3. Invoke the Application Designer for the YourSolutionName/WebApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the HyperLinkPropertyEditorAspNetModule component into the modules list on the left.
4. Define a string persistent property within your business class and decorate it with the DevExpress.Persistent.Base.EditorAliasAttribute passing the "HyperLinkStringPropertyEditor" string as a parameter. See the E2096.Module\HyperLinkDemoObject.xx file for an example.
See Also:
PropertyEditor Class
Class HyperLinkEdit
Class ASPxHyperLink
Access Editor Settings
PropertyEditors.HyperLink - Introduce the capability to show/edit a string which represents an URL or "e-mail" (DetailView/ListView and WinForms/ASP.NET)