The following basic functionality is implemented in the HyperLinkPropertyEditor.Win, HyperLinkPropertyEditor.Web and HyperLinkPropertyEditor.Mobile modules:
1. Custom PropertyEditor classes for WinForms, ASP.NET and Mobile are based on the HyperLinkEdit, ASPxHyperLink and LinkComponent controls that can be used for representing object fields, containing email address, a URL or phone number (only for a Mobile application) in the UI.
2. To validate an input, a combined RexEx mask is used in both ListView and DetailView of WinForms and ASP.NET applications. The default regular expression is the following:
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.
In Mobile applications, the CalculatedField.Getter property is used to determine whether or not the field value is a ten-digit phone number, email address or a URL, as it is shown in the MobileHyperLinkStringPropertyEditor.xx file.
3. The default email client, browser window or application for calling (only for a Mobile application) is opened after a single click on the hyperlink if it represents a valid email, web address or phone number. For end-users convenience, in DetailView of WinForms projects, a double-click is necessary to be able to easily edit the field.
Steps to implement
1. Copy and include the HyperLinkPropertyEditor.Web, HyperLinkPropertyEditor.Win and HyperLinkPropertyEditor.Mobile projects into your solution and make sure it is built successfully. Feel free to modify the settings of the underlying controls according to their documentation to better meet your business needs, e.g. provide a custom display text instead of the raw URL via the RepositoryItemHyperLinkEdit.Caption, ASPxHyperLink.Text and LinkComponent.Text options.
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. Invoke the Application Designer for the YourSolutionName/MobileApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Ctrl+Alt+X) and then drag & drop the HyperLinkPropertyEditorMobileModule component into the modules list on the left.
5. 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.
Frequently Asked Questions
E2096 - How to specify a display text for the hyper link based on a different business class property